Exemplo n.º 1
0
    public void TransitionCurrentEncounterIn(UnityAction callback = null)
    {
        // FX placement
        var pos = myRT.TransformPoint(myRT.position.x, myRT.position.y, 0);
        var go  = FX_Placement.fx_lookup.ContainsKey(GlobalStrings.SMOKE_EFFECT_2) ? FX_Placement.fx_lookup[GlobalStrings.SMOKE_EFFECT_1] : null;

        StartCoroutine(FX_Placement.FxHereAndFire(new Vector3(pos.x, pos.y, -2), go));

        // load enemy data
        TweenCGAlpha.Tween(currentEncounter.gameObject, 1.0f, 0, 1, TweenMain.Style.Once, TweenMain.Method.EaseIn, callback);
    }
Exemplo n.º 2
0
    public void TransitionCurrentEncounterOut(UnityAction callback = null)
    {
        var pos = myRT.TransformPoint(myRT.position.x, myRT.position.y, 0);
        var go  = FX_Placement.fx_lookup.ContainsKey(GlobalStrings.SMOKE_EFFECT_1) ? FX_Placement.fx_lookup[GlobalStrings.SMOKE_EFFECT_1] : null;

        StartCoroutine(FX_Placement.FxHereAndFire(new Vector3(pos.x, pos.y, -2), go));

        // load enemy data
        TweenCGAlpha.Tween(currentEncounter.gameObject, 1.0f, 1, 0, TweenMain.Style.Once, TweenMain.Method.EaseOut, callback);

        //GameplayController.RaiseGameplayEvent("Initial Encounter", PF_GamePlay.GameplayEventTypes.IntroEncounter);
    }
Exemplo n.º 3
0
    public static void CGAlphaTween(GameObject go, float duration, float alpha,
                                    int style = 0, int method = 0, LuaFunction finished = null, bool newObj = true)
    {
        UnityAction action = () =>
        {
            if (finished != null)
            {
                finished.Call();
            }
        };

        TweenCGAlpha.Tween(go, duration, alpha, (TweenMain.Style)style, (TweenMain.Method)method, (finished != null)?action:null, newObj);
    }
Exemplo n.º 4
0
    /// <summary>
    /// Outros the pane.
    /// </summary>
    /// <param name="obj">Object - object to animate out</param>
    /// <param name="duration">Duration -   how long is the transition</param>
    /// <param name="callback">Callback - method to call after the animation is complete </param>
    public static void OutroPane(GameObject obj, float duration, UnityAction callback = null)
    {
        CanvasGroup cg = obj.GetComponent <CanvasGroup>();

        if (cg != null)
        {
            cg.blocksRaycasts = false;
            TweenCGAlpha.Tween(obj, duration, 0, callback);
        }
        else
        {
            // will add a cg automatically
            TweenCGAlpha.Tween(obj, duration, 0, callback);
        }
    }