Esempio n. 1
0
    public void ResetGroup()
    {
        GroupState = GROUPSTATE.UnderConstruction;

        foreach (GameObject member in MemberUnit)
        {
            UnitScript UNIT = member.GetComponent <UnitScript>();
            UNIT.HideLifebar();
            UNIT.InteractingUnits.Clear();
            if (!UNIT.IsABuilding)
            {
                UNIT.gameObject.GetComponent <Movability>().IsMovingAsGroup = false;
                UNIT.gameObject.GetComponent <Movability>().IsGroupLeader   = false;
                //        UNIT.Options.FocussedLeftOnGround(member.transform.position);
            }
        }

        MemberUnit.Clear();
    }
Esempio n. 2
0
    void OnDestroy()
    {
        if (firststart)
        {
            firststart = false;
            Ground.Switch(0);
        }
        else
        {
            MouseEvents.RIGHTCLICK -= MouseEvents_RIGHTCLICK;
            MouseEvents.LEFTCLICK  -= MouseEvents_LEFTCLICK;
            UpdateManager.OnUpdate -= DoUpdate;

            // Destroy Lifebar if not already destroyed
            if (UNIT)
            {
                UNIT.HideLifebar();
            }
        }
    }