Example #1
0
    public void SpawnHeal()
    {
        Vector3 Position = new Vector3(0, 0.89f, -8.66f);

        pendulum      = Instantiate(Resources.Load("Pendulum_Heal"), Position, Quaternion.identity) as GameObject;
        pendulum.name = "Pendulum1";
        Movement_Attack_Dodge reference = pendulum.GetComponentInChildren <Movement_Attack_Dodge>();

        if (ChangeSpeed)
        {
            reference.speed = 2.5f;
            ChangeSpeed     = false;
        }
        else
        {
            reference.speed = Random.Range(1.0f, 1.7f);
        }
        if (ChangeSpeed2)
        {
            reference.speed = 2.5f;
            ChangeSpeed2    = false;
        }
        else
        {
            reference.speed = Random.Range(1.0f, 1.7f);
        }
    }
    void Start()
    {
        pendulumfind = GameObject.FindWithTag("Player");
        Movement_Attack_Dodge reference = pendulumfind.GetComponentInChildren <Movement_Attack_Dodge>();

        if (reference.isMoving == false)
        {
            Debug.Log("no");
            Destroy(pendulumfind, 1);
        }
    }