예제 #1
0
    public static Brain CreateBrain(BrainPrefab brainPrefab, BrainDepot depot, Vector3 position)
    {
        GameObject brainGO = (GameObject)GameObject.Instantiate(Resources.Load(brainPrefab.Path));
        Brain      brain   = brainGO.GetComponent <Brain>();

        brain.Init(position, depot);
        return(brain);
    }
 void Start()
 {
     Instance                = this;
     _brainDepot             = GetComponentInChildren <BrainDepot>();
     _showPosition           = transform.localPosition;
     _hidePosition           = _showPosition - transform.up * 5f;
     _isVisible              = false;
     transform.localPosition = _hidePosition;
 }
예제 #3
0
 void Init(Vector3 position, BrainDepot depot)
 {
     _characterController = GetComponent <CharacterController>();
     SetAppearing();
     _depot                       = depot;
     transform.parent             = depot.transform;
     transform.position           = position;
     transform.localRotation      = Quaternion.identity;
     BrainGO.transform.localScale = Vector3.one * Random.Range(1.3f, 1.88f);
 }
    void Awake()
    {
        AudioManager = GetComponent <ZombieSquadAudioManager>();
        Instance     = this;
        _zombies     = new List <Zombie>(GetComponentsInChildren <Zombie>());
        _brainDepot  = FindObjectOfType <BrainDepot>();
        if (_brainDepot == null)
        {
            Debug.LogWarning("brainDepot base is null");
        }

        _jailManager = FindObjectOfType <ZombieJailManager>();

        _humanBase = FindObjectOfType <HumanBase>();
        if (_humanBase == null)
        {
            Debug.LogWarning("human base is null");
        }

        _startTimer.WaitForSeconds(3f);
    }