Esempio n. 1
0
 void Start()
 {
     rb        = GetComponent <Rigidbody>();
     gravity   = GetComponent <Gravity>();
     anim      = GetComponent <Animator>();
     initMass  = gravity.GetMass();
     finalMass = initMass + maxSize;
     Cmass     = initMass;
 }
Esempio n. 2
0
    void SaveToggleable(ToggleableGameObjectData data)
    {
        GroupIDs gid = GetComponent <GroupIDs>();

        if (gid != null)
        {
            data.groupIDs = gid.groupIDs;
            data.active   = gid.isActive;
        }

        /*GenericHead gh = GetComponent<GenericHead>();
         * if (gh != null)
         * {
         *  data.headID = gh.headID;
         * }*/
        ToggleSprite ts = GetComponent <ToggleSprite>();

        if (ts != null)
        {
            data.spriteID = ts.SpriteID;
        }
        Gravity g = GetComponent <Gravity>();

        if (g != null)
        {
            data.mass = g.GetMass();
        }
        ToggleMovement tg = GetComponent <ToggleMovement>();

        if (tg != null)
        {
            data.toggleAmplitudeX = tg.amplitudeX;
            data.toggleAmplitudeY = tg.amplitudeY;
            data.toggleSpeedX     = tg.speedX;
            data.toggleSpeedY     = tg.speedY;
        }
    }