protected override void OnDisableEditorChild() { this.spMainCameraMotor = null; this.spCameraMotor = null; this.anchor = null; this.spLookAt = null; }
void End() { SpriteRenderer render = TargetGameObject.GetComponent <SpriteRenderer>(); Color color = render.color; color.a = 0.0f; }
void End() { SpriteRenderer render = TargetGameObject.GetComponent <SpriteRenderer>(); Color color = Color.white; render.color = color; }
private void PrepareScript() { if (null == TargetGameObject) { TargetGameObject = GameObject.FindGameObjectWithTag(TargetTag); if (null == TargetGameObject) { this.enabled = false; return; } } mPlayerDirectionDispatcher = (IPlayerDirectionDispatcher)TargetGameObject.GetComponent(typeof(IPlayerDirectionDispatcher)); if (null != mPlayerDirectionDispatcher) { mPlayerDirectionDispatcher.PlayerDirectionChanged += OnPlayerDirectionChanged; } if (null == mTransform) { mTransform = transform; } mDistanceFromTarget = DistanceFromTarget; mTargetOffset = Offset; mCentralizedPosition = GetTargetPosition(); mTransform.position = mCentralizedPosition; mTransform.LookAt(mTargetPosition); mTransform.Translate(mTargetOffset); }
//------------------------------------------------------------------------------- // Sound //------------------------------------------------------------------------------- public void Snd_SetRolloffModeLogarithmic(bool isLogarithmic) { var cmp = TargetGameObject.GetComponent <AudioSource>(); if (cmp) { cmp.rolloffMode = isLogarithmic ? AudioRolloffMode.Logarithmic : AudioRolloffMode.Linear; } }
void OnTriggerEnter2D(Collider2D collider) { //문제가 있음...Debug 요망 if (collider.gameObject.GetComponent <DocsaSakki>() != null) { ShooterGameObject.GetComponent <Hunter>().Behaviour.GrabDocsa(TargetGameObject.GetComponent <DocsaSakki>()); } Destroy(this.gameObject); }
//------------------------------------------------------------------------------- private void WithParticles(Action <ParticleSystem.MainModule> action) { var ps = TargetGameObject?.GetComponent <ParticleSystem>(); if (ps) { action.Invoke(ps.main); } }
public LedController(Xdk xdk, string gameObjectName, int ledIndex) : base(xdk, gameObjectName) { _led = Xdk.Leds[ledIndex]; if (TargetGameObject != null) { _meshRenderer = TargetGameObject.GetComponent <MeshRenderer>(); _offColor = _meshRenderer.material.color; } }
//------------------------------------------------------------------------------- private void WithMaterial(Action <Material> action) { var mat = TargetGameObject?.GetComponent <ParticleSystemRenderer>()?.material; if (mat) { action.Invoke(mat); } }
//------------------------------------------------------------------------------- //------------------------------------------------------------------------------- //------------------------------------------------------------------------------- public void SetMaterial(Material value) { var psr = TargetGameObject?.GetComponent <ParticleSystemRenderer>(); if (psr) { psr.material = value; } }
public ButtonController(Xdk xdk, string gameObjectName, int index) : base(xdk, gameObjectName) { _index = index; if (TargetGameObject != null) { _meshRenderer = TargetGameObject.GetComponent <MeshRenderer>(); _normalColor = _meshRenderer.material.color; } }
public void Cmp_CopyFromReference(MonoBehaviour reference) { if (reference == null) { Debug.LogError("[" + name + ".Cmp_CopyFromReferenceDeep]: Reference is null"); return; } TargetGameObject.CopyComponent(reference); }
private void WithMaterial_InChilds(Action <Material> action) { TargetGameObject?.GetComponentsInChildren <ParticleSystemRenderer>(true).Do(psr => { var mat = psr.material; if (mat) { action.Invoke(mat); } }); }
private void UpdateTargetAnimation() { if (TargetGameObject != null) { RuntimeAnimation animation = TargetGameObject.GetComponent <RuntimeAnimation>(); Target = animation; } else { Target = null; } }
private void MR_SetMaterial_InChilds(int index, Material material) { foreach (var cmp in TargetGameObject.GetComponentsInChildren <MeshRenderer>(true)) { var materials = cmp.materials; if (index >= materials.Length) { continue; } materials[index] = material; cmp.materials = materials; } }
public void Cmp_RemoveAsReference(MonoBehaviour reference) { if (reference == null) { Debug.LogError("[" + name + ".Cmp_RemoveAsReference]: Reference is null"); return; } var cmp = TargetGameObject.GetComponent(reference.GetType()); if (cmp) { Destroy(cmp); } }
//------------------------------------------------------------------------------- // Light //------------------------------------------------------------------------------- public void Lght_SetShadowType(int type) { var cmp = TargetGameObject.GetComponent <Light>(); if (!cmp) { return; } switch (type) { case 0: cmp.shadows = LightShadows.None; break; case 1: cmp.shadows = LightShadows.Hard; break; case 2: cmp.shadows = LightShadows.Soft; break; } }
IEnumerator Fade() { //CDebugLog.Log(ELogType.Default, "Fade Function End"); SpriteRenderer render = TargetGameObject.GetComponent <SpriteRenderer>(); float i = 0; for (float f = 1f; f >= 0; f -= 0.1f) { Color c = render.color; c.a = f; render.color = c; i = f; CDebugLog.Log(ELogType.Default, i); yield return(new WaitForSeconds(.1f)); } }
private void MR_SetMaterial(int index, Material material) { var cmp = TargetGameObject.GetComponent <MeshRenderer>(); if (cmp == null) { return; } var materials = cmp.materials; if (index >= materials.Length) { return; } materials[index] = material; cmp.materials = materials; }
public override void Update() { if (continueTime <= 0.0f) { return; } SpriteRenderer render = TargetGameObject.GetComponent <SpriteRenderer>(); Color color = render.color; color.a -= Time.fixedDeltaTime; color.a = Mathf.Max(0.0f, color.a); render.color = color; continueTime -= Time.fixedDeltaTime; if (continueTime <= 0.0f) { End(); } }
public override void Update() { if (continueTime <= 0.0f) { return; } float preAttackElapsedtime = Time.fixedTime - startTime; float plusAlpha = preAttackElapsedtime * 0.3f / startTime; SpriteRenderer render = TargetGameObject.GetComponent <SpriteRenderer>(); Color color = render.color; color.a = 0.5f + plusAlpha; render.color = color; continueTime -= Time.fixedDeltaTime; if (continueTime <= 0.0f) { End(); } }
public override void Setup(params object[] parameters) { this.target = parameters[0] as TargetGameObject; }
public void Hide() { _isEnabled = false; TargetGameObject.SetActive(false); }
public void SetMaterial_InChilds(Material value) { TargetGameObject?.GetComponentsInChildren <ParticleSystemRenderer>(true).Do(psr => psr.material = value); }
private void WithParticles_InChilds(Action <ParticleSystem.MainModule> action) { TargetGameObject?.GetComponentsInChildren <ParticleSystem>().Do(ps => action.Invoke(ps.main)); }
public void GO_ReparentTo(GameObject newParent) { TargetGameObject.Reparent(newParent); }
public void GO_DestroyAllChildren() { TargetGameObject.DestroyChildren(false); }
//------------------------------------------------------------------------------- public void GO_SetNotActive(bool value) { TargetGameObject.SetActive(!value); }
public void GO_DestroyAllChildrenImmediate() { TargetGameObject.DestroyChildren(); }
protected MultiValueGaugeController(Xdk xdk, IEnumerable <Sprite> sprites, string spriteNamePattern, string gaugeObjectName) : base(xdk, sprites.Where(s => s.name.StartsWith(spriteNamePattern)).ToArray(), gaugeObjectName) { _gaugeImage = TargetGameObject.GetComponent <Image>(); }