protected override void Awake()
    {
        base.Awake();

        cc    = GetComponent <CharacterController>();
        stat  = GetComponent <MacStat>();
        anim  = GetComponentInChildren <Animator>();
        sound = GetComponent <MonsterSound>();

        CC.detectCollisions = true;

        materialList.AddRange(mr.materials);

        _PlayerCapsule = GameObject.FindGameObjectWithTag("Player").GetComponent <CapsuleCollider>();

        MacState[] stateValues = (MacState[])System.Enum.GetValues(typeof(MacState));
        foreach (MacState s in stateValues)
        {
            System.Type FSMType = System.Type.GetType("Mac" + s.ToString());
            MacFSMState state   = (MacFSMState)GetComponent(FSMType);

            if (null == state)
            {
                state = (MacFSMState)gameObject.AddComponent(FSMType);
            }

            states.Add(s, state);
            state.enabled = false;
        }

        monsterType = MonsterType.Mac;

        agent             = GetComponent <NavMeshAgent>();
        agent.autoBraking = false;
    }
 // Start is called before the first frame update
 void Start()
 {
     flash = player.GetComponent <Flash>();
     ms    = GetComponent <MonsterSound>();
     anim  = GetComponent <Animator>();
     StartCoroutine(EnableMove());
 }
    protected override void Awake()
    {
        base.Awake();

        Instance = GetComponent <RirisFSMManager>();

        cc     = GetComponent <CharacterController>();
        stat   = GetComponent <RirisStat>();
        anim   = GetComponentInChildren <Animator>();
        sound  = GetComponent <RirisSound>();
        sound2 = GetComponent <MonsterSound>();

        for (int i = 0; i < MR.Length; i++)
        {
            materials.AddRange(MR[i].materials);
        }

        RirisState[] stateValues = (RirisState[])System.Enum.GetValues(typeof(RirisState));
        foreach (RirisState s in stateValues)
        {
            System.Type   FSMType = System.Type.GetType("Riris" + s.ToString());
            RirisFSMState state   = (RirisFSMState)GetComponent(FSMType);

            if (null == state)
            {
                state = (RirisFSMState)gameObject.AddComponent(FSMType);
            }

            states.Add(s, state);
            state.enabled = false;
        }
    }
    }                                                          //singleton

    public void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }
        else
        {
            Destroy(gameObject);
        }
    }
    protected override void Awake()
    {
        base.Awake();
        cc        = GetComponent <CharacterController>();
        stat      = GetComponent <TiberStat>();
        anim      = GetComponentInChildren <Animator>();
        sound     = GetComponent <MonsterSound>();
        rigidBody = GetComponent <Rigidbody>();

        materialList.AddRange(mr.materials);

        playerCapsule = GameObject.FindGameObjectWithTag("Player").GetComponent <CapsuleCollider>();

        TiberState[] stateValues = (TiberState[])System.Enum.GetValues(typeof(TiberState));
        foreach (TiberState s in stateValues)
        {
            System.Type   FSMType = System.Type.GetType("Tiber" + s.ToString());
            TiberFSMState state   = (TiberFSMState)GetComponent(FSMType);

            if (null == state)
            {
                state = (TiberFSMState)gameObject.AddComponent(FSMType);
            }

            states.Add(s, state);
            state.enabled = false;
        }

        CC.detectCollisions = true;

        monsterType = MonsterType.Tiber;
        Attack1Effect.SetActive(false);
        Attack2Effect.SetActive(false);
        Attack3Effect.SetActive(false);


        agent             = GetComponent <NavMeshAgent>();
        agent.autoBraking = false;
    }