public static Transform NewEditorSightTrigger(string _uuid) { SightTrigger trigger = NewSightTrigger(_uuid); trigger.ToggleAlias(true); return(trigger.transform); }
public override void setSensors() { SightTrigger sightTrigger = new SightTrigger(m_playerBuildParam.character.getGameObject()); //SoundTrigger soundTrigger = new SoundTrigger(m_playerBuildParam.character.getGameObject()); //trigger.Radius = 20.0f; GameManager.Instance.registerTrigger(sightTrigger); }
public void closeDialog() { dialogArray[0] = '\0'; SightTrigger st = GetComponent <SightTrigger>(); st.greenSight(); _dialogComplete = false; displayDialog = null; enabled = false; }
public static void ModifyGazeAlias(string _uuid, string _alias) { if (!sightTriggers.ContainsKey(_uuid)) { return; } SightTrigger trigger = sightTriggers[_uuid].GetComponent <SightTrigger>(); trigger.UpdateAlias(_alias); }
public static void ModifyGazeColor(string _uuid, int _r, int _g, int _b, int _a) { if (!sightTriggers.ContainsKey(_uuid)) { return; } SightTrigger trigger = sightTriggers[_uuid].GetComponent <SightTrigger>(); trigger.UpdateColor(_r, _g, _b, _a); }
public static void ModifyGazeIcon(string _uuid, int _icon) { if (!sightTriggers.ContainsKey(_uuid)) { return; } SightTrigger trigger = sightTriggers[_uuid].GetComponent <SightTrigger>(); trigger.UpdateIcon(_icon); }
public ItemManager im; //Be sure to attach the ItemManager object to this. //public AddItem addItem; void Start() { InitializeRects(); //addItem = gameObject.GetComponent<AddItem>(); equippedItems = new Item[10]; equippedComponents = new Component[10]; im = GameObject.Find("ItemManager").GetComponent <ItemManager>(); st = GetComponent <SightTrigger>(); saveCheck(); heldItem = im.FindItemByID(0); tempItem = im.FindItemByID(0); }
public static void ModifyColor(string _uuid, int _r, int _g, int _b, int _a) { if (!sightTriggers.ContainsKey(_uuid)) { return; } Transform trigger = sightTriggers[_uuid]; SightTrigger cpt = trigger.GetComponent <SightTrigger>(); if (null == cpt) { return; } cpt.UpdateColor(_r, _g, _b, _a); }
public static void ModifyIcon(string _uuid, int _icon) { if (!sightTriggers.ContainsKey(_uuid)) { return; } Transform trigger = sightTriggers[_uuid]; SightTrigger cpt = trigger.GetComponent <SightTrigger>(); if (null == cpt) { return; } cpt.UpdateIcon(_icon); }
private void execute() { this.LogDebug("sighttrigger execute path:{0} trigger:{1}", path, trigger); sender = this; foreach (string uuid in VRXX.Manager.BlockMgr.ListWithPath(path)) { VRXX.Manager.Block block = VRXX.Manager.BlockMgr.FindBlock(uuid); if (!block.action.Equals("Entry:OnGazeAccepted")) { continue; } if (!block.param["trigger"].Equals(trigger)) { continue; } block.Execute(); } }
// Use this for initialization void Start() { InitializeRects(); im = GameObject.Find("ItemManager").GetComponent <ItemManager>(); st = GetComponent <SightTrigger>(); scrollPosition = Vector2.zero; invPos = 0; bagPos = 0; //fill the equipment slots with empty items curWeapon = weaponSlot; curArmor = armorSlot; curBag = bagSlot; holdItem = null; tempItem = null; dropItemCheck = transform.parent.Find("DropPosition").GetComponent <DropItemCheck>(); craftObject = null; }
private static void parseBeanJson(string _beanJson) { JSONNode root = JSON.Parse(_beanJson); JSONArray slateAry = root["slates"].AsArray; foreach (JSONNode slateNode in slateAry) { string slateUUID = slateNode["guid"].Value; Slate slate = SlateMgr.NewSlate(slateUUID); slate.alias = slateNode["alias"].Value; Log.Info("BeanMgr", "parse blocks"); JSONArray pipeAry = slateNode["pipes"].AsArray; foreach (JSONNode pipeNode in pipeAry) { string pipeUUID = pipeNode["guid"].Value; JSONArray actionAry = pipeNode["actions"].AsArray; foreach (JSONNode blockNode in actionAry) { string blockUUID = blockNode["guid"].Value; Block block = BlockMgr.NewBlock(blockUUID); block.action = blockNode["action"].Value; block.path = slateUUID; slate.AppendBlock(blockUUID); JSONArray paramsAry = blockNode["params"].AsArray; foreach (JSONNode node in paramsAry) { string key = node["key"].Value; string value = node["value"].Value; block.param[key] = value; } } } Log.Info("BeanMgr", "link blocks"); slate.LinkBlocks(); Log.Info("BeanMgr", "parse preloads"); JSONArray preloadAry = slateNode["preloads"].AsArray; foreach (JSONNode node in preloadAry) { string guid = node["guid"].Value; Slate.Asset asset = slate.RegisterAsset(guid); asset.slate = slateUUID; asset.group = node["group"].Value; asset.package = node["package"].Value; asset.file = node["file"].Value; asset.guid = node["guid"].Value; asset.px = node["px"].AsFloat; asset.py = node["py"].AsFloat; asset.pz = node["pz"].AsFloat; asset.rx = node["rx"].AsFloat; asset.ry = node["ry"].AsFloat; asset.rz = node["rz"].AsFloat; asset.sx = node["sx"].AsFloat; asset.sy = node["sy"].AsFloat; asset.sz = node["sz"].AsFloat; asset.gaze = node["gaze"].AsBool; asset.gazeAlias = node["gaze.alias"].Value; } Log.Info("BeanMgr", "parse triggers"); JSONArray triggerAry = slateNode["triggers"].AsArray; foreach (JSONNode node in triggerAry) { string uuid = node["uuid"].Value; string alias = node["alias"].Value; float px = node["px"].AsFloat; float py = node["py"].AsFloat; float pz = node["pz"].AsFloat; float rx = node["rx"].AsFloat; float ry = node["ry"].AsFloat; float rz = node["rz"].AsFloat; int icon = node["icon"].AsInt; int r = node["color.r"].AsInt; int g = node["color.g"].AsInt; int b = node["color.b"].AsInt; int a = node["color.a"].AsInt; SightTrigger trigger = TriggerMgr.NewSightTrigger(uuid); trigger.trigger = alias; trigger.path = slateUUID; TriggerMgr.AdjustSightTrigger(uuid, new Vector3(px, py, pz), new Vector3(rx, ry, rz)); TriggerMgr.ModifyIcon(uuid, icon); TriggerMgr.ModifyColor(uuid, r, g, b, a); TriggerMgr.AdjustSightTrigger(uuid, new Vector3(px, py, pz), new Vector3(rx, ry, rz)); slate.RegisterTrigger(uuid); } } }
void Awake() { // Get the CDrone script cDroneScript = this.GetComponent<CDrone>(); mySightTrigger = this.GetComponentInChildren<SightTrigger>(); //sightScaleFactor = 1.0f; if(!mySightTrigger) Debug.LogError("IM BROKE"); // Who are our enemies? //Thanks Alexandre =D if(gameObject.layer == MainScript.enemyLayer) myEnemyLayer = MainScript.alliedLayer; else{ myEnemyLayer = MainScript.enemyLayer; } mySightTrigger.myEnemyLayer = myEnemyLayer; scannedColliders = new Collider[0]; }