public override void Prepare(Cannon_Fire_CS cannoFireScript)
        {
            this.cannonFireScript = cannoFireScript;

            aiScript     = transform.root.GetComponentInChildren <AI_CS>();
            turretScript = GetComponentInParent <Turret_Horizontal_CS>();
            cannonScript = GetComponent <Cannon_Vertical_CS>();
            aimingScript = GetComponentInParent <Aiming_Control_CS>();
        }
        void Initialize()
        {
            // Get the "Cannon_Fire_CS" script in the Cannon_Base.
            cannonFireScript = GetComponent <Cannon_Fire_CS>();
            if (cannonFireScript == null)
            {
                Debug.LogWarning("'Cannon_Fire_CS' script cannot be found.");
                Destroy(this);
                return;
            }

            // Get the bar Images.
            reloadingCircle = Find_Image(Reloading_Circle_Name);
            if (reloadingCircle == null)
            {
                Destroy(this);
                return;
            }

            // Get all the child images.
            reloadingCircleImages = reloadingCircle.GetComponentsInChildren <Image>();
        }
示例#3
0
 public virtual void Prepare(Cannon_Fire_CS cannonFireScript)
 {
     this.cannonFireScript = cannonFireScript;
 }
        public override void Prepare(Cannon_Fire_CS cannonFireScript)
        {
            this.cannonFireScript = cannonFireScript;

            turretScript = GetComponentInParent <Turret_Horizontal_CS>();
        }