示例#1
0
    public void Activate(string wallDirStr)
    {
        InUse = true;

        foreach (Tween tw in tweensToKill)
        {
            tw?.Kill();
        }

        bool dir_is_R = wallDirStr == "r";

        transform.position = HeroDefiner.CurrentPos + new Vector3(
            dir_is_R ? positionFromHero.x : -positionFromHero.x,
            positionFromHero.y,
            positionFromHero.z
            );
        transform.localScale = new Vector3(dir_is_R ? 1 : -1, 1, 1);
        spriteRenderer.color = new Color(1, 1, 1, 1);

        anim.Play(() => {
            tweensToKill[0] = transform.DOMoveY(100, 0.5f).SetRelative().AsHeros();
            tweensToKill[1] = spriteRenderer.DOFade(0, 0.5f).AsHeros();
            tweensToKill[2] = DOVirtual.DelayedCall(0.5f, () => {
                gameObject.SetActive(false);
                InUse = false;
            }, ignoreTimeScale: false).AsHeros();
        });
    }
示例#2
0
 public void Init(bool toRight)
 {
     if (!toRight)
     {
         transform.localScale = new Vector3(-1, 1, 1);
     }
     anim.Play(() => Destroy(gameObject));
 }
示例#3
0
文件: Kone.cs 项目: inonoa/tekiyoke2
    public void Spawn()
    {
        gameObject.SetActive(true);

        heroSensor.OnTriggerEnter2DAsObservable()
        .Where(other => other.CompareTag(Tags.Hero))
        .Take(1)
        .Subscribe(_ => Jump(HeroDefiner.CurrentPos))
        .AddTo(this);

        anim.Play();
    }