Exemplo n.º 1
0
    public override void OnStart(PartModule.StartState state)
    {
        burn = part.Modules["CL_LandingBurn"] as CL_LandingBurn;
        if (burn == null)
        {
            Debug.Log("<color=#FF8C00ff>Comfortable Landing:</color>Not detected CL_LandingBurn");
        }

        buoy = part.Modules["CL_Buoy"] as CL_Buoy;
        if (buoy == null)
        {
            Debug.Log("<color=#FF8C00ff>Comfortable Landing:</color>Not detected CL_Buoy");
        }
        airbag = part.Modules["CL_airbag"] as CL_AirBag;

        if (airbag == null)
        {
            Debug.Log("<color=#FF8C00ff>Comfortable Landing:</color>Not detected CL_AirBagg");
        }

        if (burn == null && buoy == null && airbag == null)
        {
            Events["Deactivate"].guiActive = false;
            Events["Activate"].guiActive   = false;
            IsActivate = false;
            Debug.Log("<color=#FF8C00ff>Comfortable Landing:</color>Not detected any CL Module.");
        }

        if (buoy != null && airbag != null) //They are repetitive.
        {
            airbag = null;                  //So it will not activate in FixedUpdate.
            Debug.Log("<color=#FF8C00ff>Comfortable Landing:</color>Detected CL_Buoy and CL_ Airbag, only activate CL_Buoy.");
        }
    }