mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 11:45:09 +00:00
33 lines
No EOL
853 B
C#
33 lines
No EOL
853 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using RhythmHeavenMania.Util;
|
|
using System;
|
|
|
|
namespace RhythmHeavenMania.Games.WizardsWaltz
|
|
{
|
|
public class MagicFX : MonoBehaviour
|
|
{
|
|
public Animator animator;
|
|
public SpriteRenderer spriteRenderer;
|
|
public GameObject shimmer;
|
|
|
|
public void Start()
|
|
{
|
|
int order = (int)Math.Round((transform.position.z - 2) * 1000);
|
|
spriteRenderer.sortingOrder = order;
|
|
shimmer.GetComponent<SpriteRenderer>().sortingOrder = order;
|
|
animator.Play("Magic", 0, 0);
|
|
|
|
Rigidbody2D rb2d = gameObject.AddComponent<Rigidbody2D>();
|
|
rb2d.gravityScale = 2.5f;
|
|
}
|
|
|
|
public void Kill()
|
|
{
|
|
Destroy(shimmer);
|
|
Destroy(gameObject);
|
|
}
|
|
|
|
}
|
|
} |