예제 #1
0
 protected override void OnDisableEditorChild()
 {
     this.spMainCameraMotor = null;
     this.spCameraMotor     = null;
     this.anchor            = null;
     this.spLookAt          = null;
 }
예제 #2
0
    void End()
    {
        SpriteRenderer render = TargetGameObject.GetComponent <SpriteRenderer>();
        Color          color  = render.color;

        color.a = 0.0f;
    }
예제 #3
0
    void End()
    {
        SpriteRenderer render = TargetGameObject.GetComponent <SpriteRenderer>();
        Color          color  = Color.white;

        render.color = color;
    }
예제 #4
0
    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);
    }
예제 #5
0
        //-------------------------------------------------------------------------------
        // Sound
        //-------------------------------------------------------------------------------

        public void Snd_SetRolloffModeLogarithmic(bool isLogarithmic)
        {
            var cmp = TargetGameObject.GetComponent <AudioSource>();

            if (cmp)
            {
                cmp.rolloffMode = isLogarithmic ? AudioRolloffMode.Logarithmic : AudioRolloffMode.Linear;
            }
        }
예제 #6
0
 void OnTriggerEnter2D(Collider2D collider)
 {
     //문제가 있음...Debug 요망
     if (collider.gameObject.GetComponent <DocsaSakki>() != null)
     {
         ShooterGameObject.GetComponent <Hunter>().Behaviour.GrabDocsa(TargetGameObject.GetComponent <DocsaSakki>());
     }
     Destroy(this.gameObject);
 }
예제 #7
0
        //-------------------------------------------------------------------------------

        private void WithParticles(Action <ParticleSystem.MainModule> action)
        {
            var ps = TargetGameObject?.GetComponent <ParticleSystem>();

            if (ps)
            {
                action.Invoke(ps.main);
            }
        }
예제 #8
0
 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;
     }
 }
예제 #9
0
        //-------------------------------------------------------------------------------

        private void WithMaterial(Action <Material> action)
        {
            var mat = TargetGameObject?.GetComponent <ParticleSystemRenderer>()?.material;

            if (mat)
            {
                action.Invoke(mat);
            }
        }
예제 #10
0
        //-------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------
        //-------------------------------------------------------------------------------

        public void SetMaterial(Material value)
        {
            var psr = TargetGameObject?.GetComponent <ParticleSystemRenderer>();

            if (psr)
            {
                psr.material = value;
            }
        }
예제 #11
0
 public ButtonController(Xdk xdk, string gameObjectName, int index) : base(xdk, gameObjectName)
 {
     _index = index;
     if (TargetGameObject != null)
     {
         _meshRenderer = TargetGameObject.GetComponent <MeshRenderer>();
         _normalColor  = _meshRenderer.material.color;
     }
 }
예제 #12
0
        public void Cmp_CopyFromReference(MonoBehaviour reference)
        {
            if (reference == null)
            {
                Debug.LogError("[" + name + ".Cmp_CopyFromReferenceDeep]: Reference is null");
                return;
            }

            TargetGameObject.CopyComponent(reference);
        }
예제 #13
0
 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;
     }
 }
예제 #15
0
        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;
            }
        }
예제 #16
0
        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);
            }
        }
예제 #17
0
        //-------------------------------------------------------------------------------
        // 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;
            }
        }
예제 #18
0
    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));
        }
    }
예제 #19
0
        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;
        }
예제 #20
0
    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();
        }
    }
예제 #21
0
    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();
        }
    }
예제 #22
0
 public override void Setup(params object[] parameters)
 {
     this.target = parameters[0] as TargetGameObject;
 }
예제 #23
0
 public void Hide()
 {
     _isEnabled = false;
     TargetGameObject.SetActive(false);
 }
예제 #24
0
 public void SetMaterial_InChilds(Material value)
 {
     TargetGameObject?.GetComponentsInChildren <ParticleSystemRenderer>(true).Do(psr => psr.material = value);
 }
예제 #25
0
 private void WithParticles_InChilds(Action <ParticleSystem.MainModule> action)
 {
     TargetGameObject?.GetComponentsInChildren <ParticleSystem>().Do(ps => action.Invoke(ps.main));
 }
예제 #26
0
 public void GO_ReparentTo(GameObject newParent)
 {
     TargetGameObject.Reparent(newParent);
 }
예제 #27
0
 public void GO_DestroyAllChildren()
 {
     TargetGameObject.DestroyChildren(false);
 }
예제 #28
0
        //-------------------------------------------------------------------------------

        public void GO_SetNotActive(bool value)
        {
            TargetGameObject.SetActive(!value);
        }
예제 #29
0
 public void GO_DestroyAllChildrenImmediate()
 {
     TargetGameObject.DestroyChildren();
 }
예제 #30
0
 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>();
 }