Esempio n. 1
0
    void Start()
    {
        jumpTime = jumpOneMoreTime;

        jumpVector = new Vector2(0f, jumpForce);

        coll = GetComponent <CircleCollider2D>();
        move = new Vector3(0, 0, 0);

        GameObject[] killers = GameObject.FindGameObjectsWithTag("PlayerKiller");
        foreach (GameObject killer in killers)
        {
            PlayerKiller.BecomePK(killer);
        }

        GameObject[] stateCubes = GameObject.FindGameObjectsWithTag("ObjectStateCube");
        foreach (GameObject cube in stateCubes)
        {
            ObjectState state = cube.GetComponent <ObjectState>();
            if (state != null)
            {
                if (state.isState((int)ObjectState.State.BURNING | (int)ObjectState.State.ELECTRIFIED))
                {
                    PlayerKiller.BecomePK(cube);
                }
            }
        }
    }