void SetBlueprintFromGhost(GameObject go) { go.GetComponent <BoxCollider>().isTrigger = false; BeyondComponent bc = go.GetComponent <BeyondComponent>(); go.name = bc.Template.Name; bc.SetState(State.Blueprint); EffectManager.UpdateBlueprintVisuals(go); }
public static void PlaceObject(BeyondComponent bc, string name, BC_State state) { bc.gameObject.name = name; // if the object was not snapped to a group, create a new group if (bc.beyondGroup == null) { PlaceController.Instance.CreateNewBeyondGroup(bc); } // TODO : Really need to think hard about this: will the box collider as trigger really be a general case for all elements ? bc.gameObject.GetComponent <BoxCollider>().isTrigger = false; bc.gameObject.GetComponent <BoxCollider>().enabled = true; //TODO: Un-hardcode this shit bc.gameObject.layer = 9; // TODO clean this once dragging is beautiful if (state == BC_State.Blueprint) { bc.SetState(BC_State.Blueprint); } if (state == BC_State.Ghost) { // When dragging, we place ghosts rather than blueprints bc.SetState(BC_State.Ghost); } }