public static SuppressWindow CreateWindow(CreatureModel target) { if (currentWindow.gameObject.activeSelf) { if (currentWindow.target == target) { return(currentWindow); } } else { currentWindow.gameObject.SetActive(true); currentWindow.line.gameObject.SetActive(true); currentWindow.Activate(); } SuppressWindow inst = currentWindow; inst.target = target; inst.targetType = TargetType.CREATURE; if (inst.currentSefira != target.sefira) { inst.currentSefira = target.sefira; inst.agentList.Clear(); inst.SetSprites(target.sefira); } inst.InitAgentList(); inst.ShowAgentList(); CreatureUnit unit = CreatureLayer.currentLayer.GetCreature(target.instanceId); inst.attachedPos = unit.transform; inst.ui.Init(target, inst.targetType); if (inst.activatableObjectInitiated == false) { inst.UIActivateInit(); } Canvas canvas = inst.transform.GetChild(0).GetComponent <Canvas>(); canvas.worldCamera = UIActivateManager.instance.GetCam(); currentWindow = inst; return(inst); }
public static SuppressWindow CreateWindow(AgentModel target) { if (currentWindow.gameObject.activeSelf) { if (currentWindow.target == target) { return(currentWindow); } } else { currentWindow.gameObject.SetActive(true); currentWindow.line.gameObject.SetActive(true); currentWindow.Activate(); } SuppressWindow inst = currentWindow; inst.target = target; inst.targetType = TargetType.AGENT; if (inst.currentSefira != SefiraManager.instance.GetSefira(target.currentSefira)) { inst.currentSefira = SefiraManager.instance.GetSefira(target.currentSefira); inst.agentList.Clear(); inst.SetSprites(inst.currentSefira); } inst.InitAgentList(); inst.ShowAgentList(); //inst.currentSefira = SefiraManager.instance.getSefira("1"); AgentUnit unit = AgentLayer.currentLayer.GetAgent(target.instanceId); inst.attachedPos = unit.transform; inst.ui.Init(target, inst.targetType); Canvas canvas = inst.transform.GetChild(0).GetComponent <Canvas>(); canvas.worldCamera = UIActivateManager.instance.GetCam(); currentWindow = inst; return(inst); }
public static SuppressWindow CreateNullCreatureSuppressWindow(CreatureModel nullCreature, WorkerModel model) { Debug.Log("NullCreature Suppress"); if (currentWindow.gameObject.activeSelf) { if (currentWindow.target == model) { return(currentWindow); } } else { currentWindow.gameObject.SetActive(true); currentWindow.line.gameObject.SetActive(true); currentWindow.Activate(); } SuppressWindow inst = currentWindow; inst.target = model; if (model is AgentModel) { inst.targetType = TargetType.AGENT; } else if (model is OfficerModel) { inst.targetType = TargetType.OFFICER; } Sefira modelSefira = nullCreature.sefira; if (inst.currentSefira != modelSefira) { inst.currentSefira = modelSefira; inst.agentList.Clear(); inst.SetSprites(modelSefira); } inst.InitAgentList(); inst.ShowAgentList(); CreatureUnit unit = CreatureLayer.currentLayer.GetCreature(nullCreature.instanceId); if (model is AgentModel) { AgentUnit agentUnit = AgentLayer.currentLayer.GetAgent(model.instanceId); inst.attachedPos = agentUnit.transform; inst.ui.Init(nullCreature, TargetType.CREATURE); } else if (model is OfficerModel) { OfficerUnit officerUnit = OfficerLayer.currentLayer.GetOfficer(model.instanceId); inst.attachedPos = officerUnit.transform; inst.ui.Init(nullCreature, TargetType.CREATURE); } if (inst.activatableObjectInitiated == false) { inst.UIActivateInit(); } Canvas canvas = inst.transform.GetChild(0).GetComponent <Canvas>(); canvas.worldCamera = UIActivateManager.instance.GetCam(); currentWindow = inst; Debug.Log("Null Creature's Window Opened"); return(inst); }