private void GetReferences() { _scenesManager = GetReference(_scenesManager); _objectSelect = GetReference(_objectSelect); _networkManager = GetReference(_networkManager); _gameManager = GetReference(_gameManager); }
public void SendObjectSelect( ScriptInstance instance, ViewerAgentAccessor agent, AnArray objectlocalids) { lock (instance) { ViewerConnection vc; ViewerCircuit viewerCircuit; if (m_Clients.TryGetValue(agent.AgentID, out vc) && vc.ViewerCircuits.TryGetValue((uint)agent.CircuitCode, out viewerCircuit)) { var msg = new ObjectSelect { AgentID = viewerCircuit.AgentID, SessionID = viewerCircuit.SessionID, }; foreach (IValue iv in objectlocalids) { msg.ObjectData.Add(iv.AsUInt); } viewerCircuit.SendMessage(msg); } } }
private void Start() { Renderers = gameObject.GetComponentsInChildren <MeshRenderer>(); PauseMenuScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <PauseMenu>(); ObjectSelectScript = GameObject.FindGameObjectWithTag("MainCamera").GetComponent <ObjectSelect>(); }
public void Construct() { if (_instance != null) { Destroy(_instance); } _instance = this; DontDestroyOnLoad(this); }
private void Start() { ObjectSelectScript = gameObject.GetComponent <ObjectSelect>(); Decision = GameObject.FindGameObjectWithTag("Decision"); PauseAnim = PauseMenuPanel.GetComponent <Animator>(); RestartAnim = RestartConfirmPanel.GetComponent <Animator>(); ExitAnim = ExitConfirmPanel.GetComponent <Animator>(); InfoAnim = InfoPanel.GetComponent <Animator>(); }
/// <summary> /// Converts the data in the form into a condition, and closes the form /// </summary> public void Save() { // Tell the base condition form that we modifed the condition base.Canceled = false; // First param is always the python method name List <string> Params = new List <string>(); Params.Add("object_stat"); // 1st param if (ObjectSelect.SelectedIndex == 0) { Params.Add("kits"); } else if (ObjectSelect.SelectedIndex == 1) { Params.Add("weapons"); } else { Params.Add("vehicles"); } // 2nd param if (StatSelect.SelectedIndex == 0) { Params.Add("kills"); } else if (StatSelect.SelectedIndex == 1) { Params.Add("rtime"); } else if (StatSelect.SelectedIndex == 2) { Params.Add("roadKills"); } else { Params.Add("deployed"); } // Make sure roadKills is not selected on kits and weapons if (Params.Last <string>() == "roadKills" && ObjectSelect.SelectedIndex != 2) { MessageBox.Show("Only Vehicles can use the \"Road Kills\" stat.", "Error"); ObjectSelect.Focus(); return; } // 3rd Param KeyValuePair I = (KeyValuePair)TypeSelect.SelectedItem; Params.Add(I.Key); // 4th Param (optional) if (ValueBox.Visible) { Params.Add(((int)ValueBox.Value).ToString()); } // Are we creating a new ObjectStat? if (Obj == null) { Obj = new ObjectStat(Params); } else { Obj.SetParams(Params); } // Close the form this.Node.Tag = Obj; MedalDataEditor.ChangesMade = true; this.DialogResult = DialogResult.OK; }
void Update() { if (input.GetMouseLeft) { if (!EventSystem.current.IsPointerOverGameObject()) { if (!editorObjectSpawner.GetIsPreviewing) { RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero); if (hit.collider != null) { objSelector = hit.transform.GetComponent <ObjectSelect>(); Editor_ObjectMouseFollower editorObjectFollower = hit.transform.GetComponent <Editor_ObjectMouseFollower>(); objCollision = hit.transform.GetComponent <ObjectTriggerCollision>(); if (!objSelector.GetButtonSelected && !isHoldingSelectedItem) { objSelector.moveObject(true); isHoldingSelectedItem = true; } else if (objSelector.GetButtonSelected && isHoldingSelectedItem && objCollision.GetCanPlaceObject) { Vector2 pos = Camera.main.ScreenToWorldPoint(new Vector2(Input.mousePosition.x, Input.mousePosition.y)); hit.transform.name = objSelector.GetObjectName; objSelector.placeObject(pos); isHoldingSelectedItem = false; //print("test"); } } //print("Cant place object, please select a object in your inventory."); return; } else if (editorObjectSpawner.GetIsPreviewing) { editorObjectSpawner.PlaceObject(editorObjectSpawner.GetItemInHand, editorObjectSpawner.GetObjName); if (!editorObjectSpawner.GetIsPlaced) { //print ("Cant select a object while holding a object in your hand!"); } if (editorObjectSpawner.GetIsPlaced) { editorObjectSpawner.GetMyInventory.removeItem((Item.ItemType)System.Enum.Parse(typeof(Item.ItemType), editorObjectSpawner.GetMyInventoryUI.GetCurrentType), editorObjectSpawner.GetObjName); } } } } if (input.GetMouseRight) { if (editorObjectSpawner.GetIsPreviewing) { Destroy(editorObjectSpawner.GetItemInHand); editorObjectSpawner.GetItemInHand = null; } else if (objSelector.GetButtonSelected) { if (objCollision.GetCanPlaceObject && isHoldingSelectedItem) { //print("test"); objSelector.moveObject(false); isHoldingSelectedItem = false; } } } }
void Awake() { ObjectSelect instance = ObjectSelect.Instance; }
void DeactivateObject() { activeObject.hovered = false; activeObject = null; }
void ActivateObject() { activeObject = hit.transform.gameObject.GetComponent <ObjectSelect>(); hit.collider.gameObject.GetComponent <ObjectSelect>().hovered = true; }
public void Start() { ObjectSelectScript = gameObject.GetComponent <ObjectSelect>(); PauseMenuScript = gameObject.GetComponent <PauseMenu>(); }
private void Start() { objSelect = GetComponent <ObjectSelect>(); }
private void Start() { PauseMenuScript = gameObject.GetComponent <PauseMenu>(); ObjectSelectScript = gameObject.GetComponent <ObjectSelect>(); }
public static void setObjectSelection(ObjectSelect objectSelectType) { SELECTION = objectSelectType; }