Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     // Air Ride is only doing stuff if kirby is a rider!
     if (transform.parent != null && transform.parent.tag == "Kirby" && ks == null)
     {
         ks = kirby.GetComponent <KirbyStats> ();
         calculate();
     }
 }
Exemplo n.º 2
0
    // 0 - 9 are

    /* All Up
     * Boost Up
     * Charge Up
     * Defense Up
     * Glide Up
     * HP UP
     * Offense Up
     * TopSpeed Up
     * Turn Up
     * Weight Up
     */

    // On start is assigns scripts to their variables, and ignores collision with other sprites (On layer 9).
    // Additionally, Kirby can only pick up sprites on his machine, not while walking.
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Kirby");
        ks     = player.GetComponent <KirbyStats> ();
        sp     = statSprite.GetComponent <StatPatch> ();
        sn     = player.GetComponent <StatNotifications> ();


        Physics.IgnoreLayerCollision(9, 9);
        Physics.IgnoreCollision(this.gameObject.GetComponent <SphereCollider>(), GameObject.FindGameObjectWithTag("Kirby").GetComponent <Collider>());
    }