示例#1
0
 //used to get the current sat and then enabled the screen - dont use SetActive on stationrepair.gameobject directly
 public void OpenScreen(RepairableComponent newSat)
 {
     AkSoundEngine.PostEvent("Octo_Systems_Text", gameObject);
     currentSat     = newSat;
     currentSatInfo = currentSat.gameObject.GetComponentInParent <RepairableInfo>();
     this.gameObject.SetActive(true);
 }
示例#2
0
 public ReturnToBase(Actor self, Actor dest = null, bool alwaysLand = false)
 {
     this.dest       = dest;
     this.alwaysLand = alwaysLand;
     aircraft        = self.Trait <Aircraft>();
     repairableInfo  = self.Info.TraitInfoOrDefault <RepairableInfo>();
     rearmable       = self.TraitOrDefault <Rearmable>();
 }
示例#3
0
 public ReturnToBase(Actor self, bool abortOnResupply, Actor dest = null, bool alwaysLand = true)
 {
     this.dest            = dest;
     this.alwaysLand      = alwaysLand;
     this.abortOnResupply = abortOnResupply;
     aircraft             = self.Trait <Aircraft>();
     repairableInfo       = self.Info.TraitInfoOrDefault <RepairableInfo>();
     rearmable            = self.TraitOrDefault <Rearmable>();
 }
示例#4
0
    public override bool Condition(GameObject target)
    {
        //Debug.LogError(targetSat.IsRepaired());

        if (targetSat.IsRepaired())
        {
            if (commRangeIncrease != 0)
            {
                EventModule.CommZone.AddRange(commRangeIncrease);
            }
            if (fuelBarIncrease != 0)
            {
                gameHUD.fuelUpgrade.Upgrade(fuelBarIncrease);
            }
            if (thrusterIncrease != 0)
            {
                UIRootModule.UIRoot.player.gameObject.GetComponent <MovementController>().AddThrusterImpulse(thrusterIncrease);
            }

            //reset material on object
            var mesh = targetSat.gameObject.GetComponentInChildren <MeshRenderer>();
            if (mesh != null)
            {
                mesh.material = prevMat;
            }

            //todo update widget
            ObjectivePopup(isFirstEvent);
            //Debug.Log("EVENT CONDITION MET");
            CodexProgression();
            gameHUD.objectivePanel.ClearObjectives();
            //reset scriptable object values
            targetSat = null;
            gameHUD   = null;
            prevMat   = null;
            return(true);
        }
        return(false);
    }
示例#5
0
    override public void InitializeEvent()
    {
        //Debug.Log("EVENT" + this.name);

        //get our specific satellite's repair info off the repairableroot
        targetSat = EventModule.RepairableRoot.GetRepairable(repairStation).GetComponent <RepairableInfo>();

        var mesh = targetSat.gameObject.GetComponentInChildren <MeshRenderer>();

        if (mesh != null)
        {
            prevMat       = mesh.material;
            mesh.material = highlightMat;
        }

        gameHUD = UIRootModule.UIRoot.GetScreen <GameHUD>();

        //set objective text
        gameHUD.objectivePanel.ClearObjectives();

        string objectiveUpdate = string.Format("0/1 - {0} the <color=#FFC63B>{1}</color>", actionVerb, targetSat.DisplayName);

        gameHUD.objectivePanel.AddObjective(objectiveUpdate);
    }