示例#1
0
    protected override void Awake()
    {
        base.Awake();
        weapon     = GetComponentInChildren <Weapon>();
        weakpoint  = GetComponentInChildren <Weakpoint>();
        animator   = GetComponent <Animator>();
        boostTrail = GetComponent <TrailRenderer>();

        colliders = new List <Collider2D>();

        colliders.Add(GetComponent <Collider2D>());

        Collider2D[] childColliders = GetComponentsInChildren <Collider2D>();

        for (int i = 0; i < childColliders.Length; i++)
        {
            colliders.Add(childColliders[i]);
        }

        timers = new float[timerDurations.Length];

        for (int i = 0; i < timers.Length; i++)
        {
            timers[i] = 0.0f;
        }
    }
示例#2
0
    // Use this for initialization
    protected override void Start()
    {
        base.Start();
        Gap   = 0.01f;
        index = 0;

        anim         = aiming.GetComponent <Animator>();
        anim.enabled = false;
        aiming.SetActive(false);
        shootingBarrel = GetComponentInChildren <ShootingBarrel>();
        wp             = GetComponent <Weakpoint>();

        if (WaypointCanvas != null)
        {
            foreach (var waypoint in FindObjectsOfType(typeof(Waypoint)) as Waypoint[])
            {
                waypoints.Add(waypoint);
            }

            SortedWaypoint = WaypointCanvas.GetComponentsInChildren <Waypoint>().ToList();
        }

        CurrentTransform = gameObject.transform;
        //Set the gameobject to active on start
        gameObject.SetActive(false);

        wp.enabled = false;

        shown = false;
    }