示例#1
0
 private void OnFinish(bool success)
 {
     if (this.m_Objectives.Count > this.m_ObjectiveIndex)
     {
         ObjectivesManager.Get().DeactivateObjective(this.m_Objectives[this.m_ObjectiveIndex]);
     }
     HUDChallengeTimer.Get().Deactivate();
     HUDChallengeInfo.Get().Deactivate();
     HUDChallengeResult.Get().Activate(success, this);
     Player.Get().BlockMoves();
     Player.Get().BlockRotation();
     ChallengesManager.Get().OnFinishChallenge(success);
 }
示例#2
0
 public void OnDestroyConstruction(Construction con)
 {
     foreach (ConstructionGhost constructionGhost in this.m_Data.Keys)
     {
         if (this.m_Data[constructionGhost] == con && !constructionGhost.gameObject.activeSelf)
         {
             constructionGhost.Reset();
             constructionGhost.gameObject.SetActive(true);
             HUDChallengeInfo.Get().SetupText(this);
         }
     }
     con.UnregisterObserver(this);
 }
示例#3
0
 public void OnCreateConstruction(ConstructionGhost ghost, Item created_item)
 {
     foreach (ConstructionGhost y in this.m_Data.Keys)
     {
         if (ghost == y)
         {
             Construction component = created_item.gameObject.GetComponent <Construction>();
             DebugUtils.Assert(component, true);
             this.m_Data[ghost] = component;
             HUDChallengeInfo.Get().SetupText(this);
             component.RegisterObserver(this);
             break;
         }
     }
 }
示例#4
0
 public virtual void Activate(GameObject parent)
 {
     this.m_Parent = parent;
     this.m_Parent.SetActive(true);
     this.m_ObjectiveIndex = 0;
     for (int i = 0; i < parent.transform.childCount; i++)
     {
         GameObject gameObject = parent.transform.GetChild(i).gameObject;
         gameObject.SetActive(true);
         if (gameObject.name == "Start")
         {
             Player.Get().Teleport(gameObject, false);
         }
     }
     if (this.m_Objectives.Count > this.m_ObjectiveIndex)
     {
         ObjectivesManager.Get().ActivateObjective(this.m_Objectives[this.m_ObjectiveIndex]);
     }
     MainLevel.Instance.m_TODSky.Cycle.DateTime = this.m_StartDate;
     MainLevel.Instance.m_TODSky.Cycle.GameTime = 0f;
     HUDChallengeTimer.Get().Activate(this);
     HUDChallengeInfo.Get().Activate(this);
 }