public void EquipRunes(GameObject obj) { rc = obj.GetComponent <RuneController>(); obj.transform.SetParent(gameObject.transform.Find("Wrist")); obj.transform.localPosition = new Vector3(0, 0, 0); obj.transform.localRotation = Quaternion.identity; }
public CryonisRune(RuneProfile profile, Player player, LayerMask layerMask, LayerMask iceblockMask, RuneController controller) : base(profile) { this.player = player; this.layerMask = layerMask; this.iceblockMask = iceblockMask; Addressables.LoadAssetAsync <GameObject>("Assets/Prefabs/Miscellaneous/Target.prefab").Completed += handle => { targetPrefab = handle.Result; }; Addressables.LoadAssetAsync <GameObject>("Assets/Prefabs/Miscellaneous/Iceblock.prefab").Completed += handle => { iceBlockPrefab = handle.Result; }; this.controller = controller; hits = new RaycastHit[20]; blocks = new IceBlock[3]; colliders = new Collider[3]; }
public BombRune(RuneProfile runeProfile, Player player, RuneController controller) : base(runeProfile) { this.player = player; this.controller = controller; if (runeProfile.RuneType == RuneType.RemoteBombBox) { Addressables.LoadAssetAsync <GameObject>("Assets/Prefabs/Miscellaneous/BoxBomb.prefab").Completed += handle => { bombPrefab = handle.Result; }; } else { if (runeProfile.RuneType == RuneType.RemoteBombSphere) { Addressables.LoadAssetAsync <GameObject>("Assets/Prefabs/Miscellaneous/SphereBomb.prefab").Completed += handle => { bombPrefab = handle.Result; } } ; } }
private void Awake() { runeController = GetComponent <RuneController>(); }
public override void Update() { rotator = left.transform.Find("Wrist").Find("Runes(Clone)").Find("Rotator").gameObject; runeController = left.transform.Find("Wrist").Find("Runes(Clone)").GetComponent <RuneController>(); //if (tap.GetStateDown(SteamVR_Input_Sources.LeftHand)) //{ // float x = pos.GetAxis(SteamVR_Input_Sources.LeftHand).x; // rotator.transform.Rotate(0, 0, (x / Mathf.Abs(x)) * 45); //} TrackpadRotation(); string word = runeController.GetSelected().name; bool ready = runeController.GetSpellReady(); if (grab.GetState(SteamVR_Input_Sources.LeftHand) && word != null && ready) { if (runeController != null) { runeController.SetCooldown(word, 0f); } //GameObject.Find("Globals").GetComponent<Globals>().rotationSave = rotator.transform.localRotation.z; Time.timeScale = 1f; startTime = false; startingTime = 0f; Disable(); switch (word) { case "Arrow": GameObject.Find("WeaponsController").gameObject.GetComponent <WeaponsController>().currentWeapon = WeaponsController.Weapons.Bow; break; case "Ice": GameObject.Find("WeaponsController").gameObject.GetComponent <WeaponsController>().currentWeapon = WeaponsController.Weapons.Ice; break; case "Sword": GameObject.Find("WeaponsController").gameObject.GetComponent <WeaponsController>().currentWeapon = WeaponsController.Weapons.Sword; break; case "Fire": GameObject.Find("WeaponsController").gameObject.GetComponent <WeaponsController>().currentWeapon = WeaponsController.Weapons.Fire; break; case "Lightning": GameObject.Find("WeaponsController").gameObject.GetComponent <WeaponsController>().currentWeapon = WeaponsController.Weapons.Lightning; break; case "Air": GameObject.Find("WeaponsController").gameObject.GetComponent <WeaponsController>().currentWeapon = WeaponsController.Weapons.Air; break; } } if (startTime) { Time.timeScale = Mathf.Lerp(0.1f, 1f, (Time.realtimeSinceStartup - startingTime) / duration); } if (Time.realtimeSinceStartup - startingTime > duration) { startTime = false; Time.timeScale = 1f; } }
public override void Start() { rotator = left.transform.Find("Wrist").Find("Runes(Clone)").Find("Rotator").gameObject; runeController = left.transform.Find("Wrist").Find("Runes(Clone)").GetComponent <RuneController>(); }
private void Start() { runeController = FindObjectOfType <RuneController>(); isruneControllerNotNull = runeController != null; }