Beispiel #1
0
    protected override void InitAwake()
    {
        base.InitAwake();
        if (player == null)
        {
            player = transform;
        }

        moveControl = GetComponent <CharacterMoveControl>();

        instance = this;

        if (aniControl == null)
        {
            aniControl = GetComponentInChildren <CharacterAnimationControl>();
        }

        if (aniControl != null)
        {
            aniControl.Weapon = Weapon;
        }
        else
        {
            Debug.Log("[IcarusPlayerController][InitAwake]: CharacterAnimationControl is null!");
        }
    }
Beispiel #2
0
 private void OnTriggerStay(Collider other)
 {
     if ("Player".Equals(other.tag) && attackOnOff)
     {
         enemyController.Attack();
         player = null;
     }
 }
Beispiel #3
0
 private void OnTriggerEnter(Collider other)
 {
     if ("Player".Equals(other.tag) && player == null)
     {
         enemyController.Attack();
         player = other.GetComponent <IcarusPlayerController>();
     }
 }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     camera = CameraControl.GetInstance().GetComponent <Camera>();
     player = IcarusPlayerController.GetInstance();
     if (gameObject.name == "Begin")
     {
         isImBegin = true;
     }
 }
Beispiel #5
0
    protected override void InitStart()
    {
        base.InitStart();
        #region WayPoints
        path = GetComponent <Path>();
        if (path != null)
        {
            bool isError = false;
            listWayPoints = path.WayPoints;
            if (listWayPoints == null)
            {
                isError = true;
                Debug.Log("[EnemyState][" + gameObject.name + "]: listWayPoins nula.");
            }
            else
            {
                if (listWayPoints.Count == 0)
                {
                    Debug.Log("[EnemyState][" + gameObject.name + "]: listWayPoins vazia.");
                    isError = true;
                }
                else
                {
                    for (int i = 0; i < listWayPoints.Count; i++)
                    {
                        if (listWayPoints[i] == null)
                        {
                            listWayPoints.Clear();
                            listWayPoints.Add(transform);
                            Debug.Log("[EnemyState][" + gameObject.name + "]: A posição (" + i + ") da listWayPoins está nula.");
                            isError = true;
                            break;
                        }
                    }
                }
            }

            if (isError)
            {
                listWayPoints = new List <Transform>();
                listWayPoints.Add(transform);
            }
        }
        monitoringPoint = listWayPoints[actualWp];
        #endregion

        moveControl.BodyMiniMap.gameObject.SetActive(false);
        playerTarget = IcarusPlayerController.GetInstance();
        playerStatus = playerTarget.gameObject.GetComponent <CharacterStatus>();
        enemyStatus.BoxCollider.enabled = true;
        IniState();
    }