Esempio n. 1
0
        void CheckClickedEnemy()
        {
            if (!CombatManager.isPlanningPhase)
            {
                return;
            }

            if (Input.GetMouseButtonDown(0))
            {
                RaycastHit hitInfo;
                Ray        mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition);
                Physics.Raycast(mouseRay, out hitInfo, 100, clickMask);

                if (!hitInfo.collider)
                {
                    return;
                }

                EnemyController e = hitInfo.collider.GetComponentInParent <EnemyController>();
                if (!e)
                {
                    return;
                }

                CombatManager.AddCharacterCommand(e.enemyData);
                print("added attack command");
            }
        }