Ejemplo n.º 1
0
    public void RandomFaceActorPlay(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        float min = param.GetFloat(0);
        float max = param.GetFloat(1);

        if (min < max)
        {
            for (int i = 0; i < param.ObjectList.Count; ++i)
            {
                float     v  = Random.Range(min, max);
                Transform tr = param.ObjectList[i].GetComponent <Transform>();
                if (tr != null)
                {
                    tr.Rotate(Vector3.up, v);
                }
            }
        }

        ActorPlay(paramName);
    }
Ejemplo n.º 2
0
    public void FadeOutToGivenCamera(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        Camera cam = GetCameraFromParam(param, 0);

        if (cam != null)
        {
            FadeEffect fadeEffect = GetARequiredComponent <FadeEffect>(cam.gameObject);
            if (fadeEffect == null)
            {
                return;
            }

            Color curColor  = fadeEffect.blendColor;
            Color destColor = Color.black;
            float duration  = param.GetFloat(0);

            TweenColorInternal(fadeEffect, curColor, destColor, duration);
        }
    }
Ejemplo n.º 3
0
    public void ActorPlayWithRoot(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        string actionName = param.GetString(0);

        if (actionName != "")
        {
            GameObject root = param.GetGameObject(0);
            if (root == null)
            {
                return;
            }

            Animation[] animList = root.GetComponentsInChildren <Animation>();
            for (int i = 0; i < animList.Length; ++i)
            {
                if (animList[i] != null)
                {
                    animList[i].Play(actionName);
                }
            }
        }
    }
Ejemplo n.º 4
0
    public void RandomFaceActorPlayWithRoot(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        float min = param.GetFloat(0);
        float max = param.GetFloat(1);

        if (min < max)
        {
            GameObject root = param.GetGameObject(0);
            if (root == null)
            {
                return;
            }
            Transform[] list = root.GetComponentsInChildren <Transform>();
            for (int i = 0; i < list.Length; ++i)
            {
                float v = Random.Range(min, max);
                if (list[i] != null)
                {
                    list[i].Rotate(Vector3.up, v);
                }
            }
        }
    }
Ejemplo n.º 5
0
    public void PlayAnimation(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        GameObject obj = param.GetGameObject(0);

        PlayAnimationInPrefab(obj);
    }
Ejemplo n.º 6
0
    public void CameraShake(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }
        GameObject center = param.GetGameObject(0);

        //float radius = param.GetFloat(0);
        bool shouldStart = false;

        if (center != null)
        {
            //if( CoreEntry.gTeamMgr.MainPlayer != null )
            //{
            //    if( radius <= 0 )
            //    {
            //        shouldStart = true;
            //    }
            //    else if ((CoreEntry.gTeamMgr.MainPlayer.transform.position - center.transform.position).magnitude <= radius)
            //    {
            //        shouldStart = true;
            //    }
            //}
        }
        else
        {
            shouldStart = true;
        }

        if (shouldStart)
        {
            Camera cam = GetCameraFromParam(param, 1);
            if (cam != null)
            {
                float scale = param.GetFloat(1);
                if (scale <= 0f)
                {
                    scale = 1f;
                }
                CameraEffect effect = GetARequiredComponent <CameraEffect>(cam.gameObject);
                if (effect != null)
                {
                    effect.Scale = scale;
                    effect.ShakeStart();
                }
            }
        }
    }
Ejemplo n.º 7
0
    public void ResetRotation(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        GameObject obj = param.GetGameObject(0);

        if (obj != null)
        {
            obj.transform.localRotation = Quaternion.identity;
        }
    }
Ejemplo n.º 8
0
    //Color destColor;
    // Color curColor;
    //FadeEffect fadeFffect = null;
    // float fadeDuration = 1.0f;

    public Camera GetCameraFromParam(PA_Param param, int index)
    {
        Camera     cam = null;
        GameObject obj = param.GetGameObject(index);

        if (obj != null)
        {
            cam = obj.GetComponent <Camera>();
        }

        if (cam == null)
        {
            cam = Camera.main;
        }

        return(cam);
    }
Ejemplo n.º 9
0
    public void TurnToBoss(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        GameObject obj = param.GetGameObject(0);

        if (obj != null)
        {
            GameObject tmpBoss = GetBoss();

            Transform chestSocket = tmpBoss.GetComponent <ActorObj>().GetChildTransform("E_Spine");
            float     time        = param.GetFloat(0);
            StartCoroutine(TuningToObject(obj, chestSocket, time));
        }
    }
Ejemplo n.º 10
0
    public void RandomDelayReplay(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        float min = param.GetFloat(0);
        float max = param.GetFloat(1);

        if (max <= min)
        {
            Replay();
        }
        else
        {
            float v = Random.Range(min, max);
            Invoke("Replay", v);
        }
    }
Ejemplo n.º 11
0
    public void ActorPlay(string paramName)
    {
        PA_Param param = FindParam(paramName);

        if (param == null)
        {
            return;
        }

        string actionName = param.GetString(0);

        if (actionName != "")
        {
            for (int i = 0; i < param.ObjectList.Count; ++i)
            {
                Animation anim = param.ObjectList[i].GetComponent <Animation>();
                if (anim != null)
                {
                    anim.Play(actionName);
                }
            }
        }
    }