示例#1
0
    protected virtual void Collect(BuildingIdentity id, ResourceType type, CollectMethod collectMethod = CollectMethod.Button)
    {
        if (SceneManager.Instance.SceneMode == SceneMode.SceneVisit || this.m_CurrentState != BuildingEditorState.Normal || !this.BuildingBehavior.CheckBuildingCreateStack())
        {
            return;
        }
        if (this.m_CurrentState == BuildingEditorState.Normal)
        {
            switch (collectMethod)
            {
            case CollectMethod.Building:
                if (SystemFunction.CheckCollectValidity(this.BuildingLogicData, type) > 0)
                {
                    SceneManager.Instance.CreateCollectFX(this.BuildingBehavior, type, LogicController.Instance.Collect(id, type), this.BuildingLogicData);
                }
                //this.CreateCollectFX(type, LogicController.Instance.Collect(id, type));
                break;

            case CollectMethod.Button:
                if (SystemFunction.CheckCollectValidityByButton(this.BuildingLogicData, type))
                {
                    SceneManager.Instance.CreateCollectFX(this.BuildingBehavior, type, LogicController.Instance.Collect(id, type), this.BuildingLogicData);
                }
                //this.CreateCollectFX(type, LogicController.Instance.Collect(id, type));
                break;
            }
        }
    }