public void StartPlacement() { Debug.Log("Starting placement in create campsite"); mPlacementStarted = true; GameObject skillSphere = new GameObject(name); SkillSphere = skillSphere.AddComponent <EffectSphere>(); SkillSphere.TargetRadius = EffectRadius; SkillSphere.StartTime = WorldClock.AdjustedRealTime; SkillSphere.RTDuration = Mathf.Infinity; SkillSphere.RTExpansionTime = 1.0f; SkillSphere.OnIntersectItemOfInterest += OnIntersectItemOfInterest; SkillSphere.RequireLineOfSight = false; GameObject effectSphere = new GameObject(name + " Effect"); EffectSphereTransform = effectSphere.transform; effectSphere.layer = Globals.LayerNumScenery; MeshFilter mf = effectSphere.AddComponent <MeshFilter>(); MeshRenderer mr = effectSphere.AddComponent <MeshRenderer>(); mf.sharedMesh = Meshes.Get.EffectSphereMesh; mr.sharedMaterial = Mats.Get.ItemPlacementMaterial; mr.castShadows = false; mr.receiveShadows = false; PlacementMaterial = mr.material; }
protected override void OnUseStart() { GameObject skillSphere = new GameObject(name); skillSphere.transform.position = Player.Local.Position; SkillSphere = skillSphere.AddComponent(Type.GetType("Frontiers.World.Gameplay." + Extensions.EffectSphereScriptName)) as EffectSphere; //UnityEngineInternal.APIUpdaterRuntimeServices.AddComponent(skillSphere, "Assets/Scripts/Skills/RangedSkill.cs (18,21)", Extensions.EffectSphereScriptName) as EffectSphere; SkillSphere.TargetRadius = EffectRadius; SkillSphere.StartTime = WorldClock.AdjustedRealTime; SkillSphere.RTDuration = EffectTime; SkillSphere.RTCooldownTime = Usage.CooldownInterval; SkillSphere.RTExpansionTime = 1.0f; SkillSphere.OnIntersectItemOfInterest += OnIntersectItemOfInterest; SkillSphere.RequireLineOfSight = false; }