示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        // Debug.Log(_newPosition.position);

        if (other.GetComponent <WolfBehaviour>())
        {
            WolfBehaviour wolf = other.GetComponent <WolfBehaviour>();

            Instantiate(_dragonAI, _ghostPosition);
            wolf.SetState(new SplitState(wolf, _newPosition));
        }
        else if (other.GetComponent <DragonBehaviour>())
        {
            DragonBehaviour dragon = other.GetComponent <DragonBehaviour>();

            Instantiate(_wolfAI, _ghostPosition);
            dragon.SetState(new SplitState(dragon, _newPosition));
        }
    }