Example #1
0
        private void SpawnPeriodic(GameObjectPosition gameObjectPos)
        {
            timeCount -= Time.deltaTime;

            if (timeCount <= 0f)
            {
                timeCount = period;
                Instantiate(gameObjectPos.gameObject, gameObjectPos.position, Quaternion.identity);
            }
        }
Example #2
0
        /// <summary>
        /// Expecting GameObjectPosition
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override object Do(object obj)
        {
            GameObjectPosition gameObjectPos = obj as GameObjectPosition;

            if (gameObjectPos == null)
            {
                Debug.LogWarning("Casting to GameObjectPosition failed!");
                return(null);
            }

            SpawnPeriodic(gameObjectPos);

            return(null);
        }
Example #3
0
        /// <summary>
        /// Expecting GameObjectPosition
        /// </summary>
        /// <param name="obj"></param>
        /// <returns></returns>
        public override object Do(object obj)
        {
            GameObjectPosition gameObjectPos = obj as GameObjectPosition;

            if (gameObjectPos == null)
            {
                Debug.LogWarning("Casting to GameObjectPosition failed!");
                return(null);
            }

            Instantiate(gameObjectPos.gameObject, gameObjectPos.position, Quaternion.identity);

            return(null);
        }