private void CreateRunes() { var player = GetComponent <Player>(); for (int index = 0; index < profiles.Length; index++) { RuneProfile profile = profiles[index]; if (profile.RuneType == RuneType.Magnesis) { runes.Add(new MagnesisRune(profile, player, interactableLayer.value, 5.0f)); } else if (profile.RuneType == RuneType.RemoteBombSphere) { runes.Add(new BombRune(profile, player, this)); } else if (profile.RuneType == RuneType.RemoteBombBox) { runes.Add(new BombRune(profile, player, this)); } else if (profile.RuneType == RuneType.Cryonis) { runes.Add(new CryonisRune(profile, player, cryonisLayerMask, iceblockLayerMask, this)); } else if (profile.RuneType == RuneType.Stasis) { runes.Add(new StasisRune(profile, player, interactableLayer.value, this)); } else { throw new ArgumentOutOfRangeException(); } OnCreatedRune.Invoke(runes[index]); } }
public MagnesisRune(RuneProfile profile, Player player, int layerMask, float speed) : base(profile) { this.player = player; this.layerMask = layerMask; this.speed = speed; Addressables.LoadAssetAsync <GameObject>("Assets/Prefabs/Miscellaneous/Laser.prefab").Completed += handle => { laserPrefab = handle.Result; }; }
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; } } ; } }
protected Rune(RuneProfile profile) { this.Profile = profile; }