private void Start() { instance = this; m_dt = 0; translation = 0f; straffe = 0f; isHoodOnPlaying = false; isHoodOn = false; isHoodOffPlaying = false; isOnIdle = false; isAttackPlaying = false; m_characterSprite = GetComponent <SpriteRenderer>(); m_anim = GetComponent <Script_AnimationMgr>(); m_originalcolCenter = GetComponent <CapsuleCollider>().center; m_originalcolHeight = GetComponent <CapsuleCollider>().height; }
// Start is called before the first frame update void Start() { m_anim = GetComponentInParent <Script_AnimationMgr>(); instance = this; invertDetection = new BT_Inverter(new BT_Detect(this, m_fov.m_visibleTargets, m_soundCheck)); invertCatch = new BT_Inverter(new BT_Catch(this, ARRIVAL_RANGE)); m_targetPos = transform.position; m_target = transform; m_idleSequence = new BT_Sequence(new List <Script_BTNode> { new BT_Idle(this, transform), new BT_Wander(this, SEARCH_RANGE), }); m_catchSequence = new BT_Sequence(new List <Script_BTNode> { new BT_Catch(this, CATCH_RANGE), }); m_detectionSequence = new BT_Sequence(new List <Script_BTNode> { invertDetection, new BT_CheckArrival(this, ARRIVAL_RANGE), m_idleSequence }); m_moveSequence = new BT_Sequence(new List <Script_BTNode> { new BT_Approach(this), }); m_rootAI = new BT_Selector(new List <Script_BTNode> { m_detectionSequence, m_catchSequence, m_moveSequence, }); new BT_Wander(this, SEARCH_RANGE); }