示例#1
0
 void Start()
 {
     turnManager = FindObjectOfType <TurnManager>();
     players     = FindObjectsOfType <Register>();
     bot         = GetComponent <BotMovement>();
     deck        = GetComponent <Deck>();
 }
示例#2
0
        //TODO Add laser particle
        private void OnFireLasers()
        {
            RaycastHit hit;

            if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, Mathf.Infinity))
            {
                BotMovement bot = hit.collider.GetComponent <BotMovement>();
                if (bot != null)
                {
                    Deck deck = bot.GetComponent <Deck>();
                    deck.DiscardCard(spamCard);
                }
            }
        }
示例#3
0
        public void PushBot(BotMovement bot, Vector3 direction)
        {
            bot.transform.position += direction;
            Waypoint result = bot.gridPositionHandler.FixPositionToWaypoint();

            if (result == null)
            {
                bot.DestroyBot();
            }
            if (bot.isAlive)
            {
                bot.CheckForBotCollision(bot.GetComponent <GridPositionHandler>().CurrentWaypoint, direction);
            }
        }