예제 #1
0
    public void Awake()
    {
        if (brainType.Equals(BrainType.PLAYER))
        {
            brain = new PlayerBrain();
        }
        else
        {
            brain = new CatAIBrain();
        }

        animator        = GetComponent <Animator>();
        rigidbody       = GetComponent <Rigidbody>();
        slideSpeedForce = slideSpeed;
    }
예제 #2
0
        public void changeBrainIfNeeded(BrainType newBrainType)
        {
            if (!newBrainType.Equals(brainType))
            {
                brain     = createBrainOfType(newBrainType);
                brainType = newBrainType;
            }

            if (brain == null)
            {
                Debug.LogWarning("Brain type not set, using NOP");
                brain = createBrainOfType(BrainType.NOP);
            }
        }