void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2) { switch (ee) { case CGME.EngineEvent.TransferChild: TransferObjects(param1, param2); break; } }
//void CGME.EngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2); protected CGMObject AddChild(CGME.CGObject obj, string type) { GameObject child = new GameObject(obj.CGType); child.AddComponent(type); child.SendMessage("SetObject", obj); child.transform.parent = transform; //child.name = obj.Name; return(child.GetComponent <CGMObject>()); }
protected override void RemoveChild(CGME.CGObject cgobj) { for (int i = 0; i < transform.childCount; i++) { Card child = transform.GetChild(i).GetComponent <Card>(); if (child != null && child.CGME_Card == (cgobj as CGME.Card)) { Destroy(child.gameObject); } } }
void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2) { switch (ee) { case CGME.EngineEvent.AddChild: break; case CGME.EngineEvent.AddResource: AddChild(param1, "Resource"); break; } }
void TransferObjects(CGME.CGObject target, CGME.CGObject destination) { CGMObject cgm_target = FindObject(target); CGMObject cgm_dest = FindObject(destination); if (cgm_target != null && cgm_dest != null) { //Debug.Log ("Transfering"); cgm_target.gameObject.transform.parent = cgm_dest.transform; cgm_dest.Reposition(); } }
void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2) { switch (ee) { case CGME.EngineEvent.SetId: ID = param1.Id; break; case CGME.EngineEvent.ModifyResource: view.Update(); break; } }
CGM.CGMObject FindObject(CGME.CGObject cgme_obj) { CGM.CGMObject[] cgm_obj_array = FindObjectsOfType <CGMObject>(); foreach (CGMObject cgm_obj in cgm_obj_array) { if (cgm_obj.ID == cgme_obj.Id) { return(cgm_obj); } } return(null); }
void CGME.IActionEventListener.ActEvent(CGME.CustomActionEvent action, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2) { switch (action) { case CGME.CustomActionEvent.FocusObject: if (param1 is CGME.Actor) { FocusObject(param1 as CGME.Actor); } else { Debug.Log(param1.CGType + " cannot be focused on"); } break; } }
void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2) { switch (ee) { case CGME.EngineEvent.SetId: ID = param1.Id; break; case CGME.EngineEvent.AddResource: AddChild(param1, "Resource"); break; case CGME.EngineEvent.BufferSelect: renderer.material.color = Color.gray; break; case CGME.EngineEvent.BufferRemove: renderer.material.color = Color.white; break; } }
// void Start(){ // RegisterCards(); // RegisterResources(); // SetListener (); // // } void CGME.IEngineListener.Act(CGME.EngineEvent ee, CGME.CGObject source, CGME.CGObject param1, CGME.CGObject param2) { switch (ee) { case CGME.EngineEvent.SetId: ID = param1.Id; break; // case CGME.EngineEvent.AddChild: // //AddChild (param1,"Card"); // break; // case CGME.EngineEvent.TransferChild: // //RemoveChild (param1); // break; case CGME.EngineEvent.AddResource: AddChild(param1, "Resource"); break; case CGME.EngineEvent.UpdateChildren: UpdateChildren(); break; } }
public override void SetObject(CGME.CGObject cgobj) { CGME_Player = (CGME.Player)cgobj; }
public override void SetObject(CGME.CGObject cgobj) { CGME_Card = (CGME.Card)cgobj; }
//protected abstract void Register(CGMObject parent); //protected abstract void RegisterResources(); public abstract void SetObject(CGME.CGObject cgobj);
public override void SetObject(CGME.CGObject cgobj) { CGME_Deck = (CGME.Deck)cgobj; }
public override void SetObject(CGME.CGObject cgobj) { return; }
protected virtual void RemoveChild(CGME.CGObject obj) { }
// public Resource(){ // if (CGME_resource == null)CGME_resource = new CGME.ResourceNumber(); // // //Resource_type = // } public void SetObject(CGME.CGObject cgobj) { CGME_resource = (CGME.Resource)cgobj; }
public override void SetObject(CGME.CGObject cgobj) { CGME_Phase = (CGME.Phase)cgobj; }
public override void SetObject(CGME.CGObject cgobj) { CGME_game = (CGME.Game)cgobj; }
public override void SetObject(CGME.CGObject cgobj) { CGME_action_root = (CGME.ActionGroup)cgobj; }