예제 #1
0
 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;
 }
예제 #2
0
 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];
 }
예제 #3
0
 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; }
         }
         ;
     }
 }
예제 #4
0
 private void Awake()
 {
     runeController = GetComponent <RuneController>();
 }
예제 #5
0
    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;
        }
    }
예제 #6
0
 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>();
 }
예제 #7
0
 private void Start()
 {
     runeController          = FindObjectOfType <RuneController>();
     isruneControllerNotNull = runeController != null;
 }