private void OnEnterState() { ConstructionGhost.GhostState state = this.m_State; if (state != ConstructionGhost.GhostState.Dragging) { if (state != ConstructionGhost.GhostState.Building) { if (state == ConstructionGhost.GhostState.Ready) { this.CreateConstruction(); UnityEngine.Object.Destroy(base.gameObject); HUDGather.Get().Setup(); } } else { foreach (GhostStep ghostStep in this.m_Steps) { foreach (GhostSlot ghostSlot in ghostStep.m_Slots) { ghostSlot.Init(); } } this.SetupCurrentStep(); HUDGather.Get().Setup(); } } else { this.UpdateState(); } }
private void UpdateState() { ConstructionGhost.GhostState state = this.m_State; if (state != ConstructionGhost.GhostState.Dragging) { if (state == ConstructionGhost.GhostState.Building) { if (this.IsReady()) { this.SetState(ConstructionGhost.GhostState.Ready); } } } else { this.UpdateRotation(); this.UpdateTransform(); this.UpdateColor(); } }
public void SetState(ConstructionGhost.GhostState state) { this.m_State = state; this.OnEnterState(); }