Ejemplo n.º 1
0
 void Start()
 {
     animator     = GetComponent <Animator>();
     netEntity    = GetComponent <UnityNetEntity>().netEntity;
     count        = animator.parameterCount;
     types        = new FastType[count];
     animatorSync = new AnimatorSync(netEntity, (byte)count, this);
     names        = new string[count];
     floatsLearp  = new float[count];
     floatsTarget = new float[count];
     for (int i = 0; i < animator.parameterCount; i++)
     {
         if (animator.GetParameter(i).type == AnimatorControllerParameterType.Bool)
         {
             names[i] = animator.GetParameter(i).name;
             animatorSync.RegParameter(i, animator.GetBool(names[i]));
             types[i] = FastType._bool;
         }
         if (animator.GetParameter(i).type == AnimatorControllerParameterType.Float)
         {
             names[i] = animator.GetParameter(i).name;
             animatorSync.RegParameter(i, animator.GetFloat(names[i]));
             types[i] = FastType._float;
         }
         if (animator.GetParameter(i).type == AnimatorControllerParameterType.Int)
         {
             names[i] = animator.GetParameter(i).name;
             animatorSync.RegParameter(i, animator.GetInteger(names[i]));
             types[i] = FastType._int;
         }
     }
 }
Ejemplo n.º 2
0
    private ClientNetEntity OnGalaxyNetEntityInstantiate(ClientNetEntity netEntity)
    {
        //Debug.Log(netEntity.prefabName);
        // если нет имени у сетевой сущности, значит не нужно создавать для неё go
        if (netEntity.prefabName == "")
        {
            return(null);
        }
        UnityNetEntity go = Instantiate(Resources.Load <UnityNetEntity>(netEntity.prefabName), netEntity.transform.position.Vector3(), netEntity.transform.rotation.Quaternion());

        // возвращяем целевой экземпляр ClientNetEntity из нового go
        return(go.netEntity);
    }
Ejemplo n.º 3
0
 void Awake()
 {
     netEntity = GetComponent <UnityNetEntity>().netEntity;
     material  = GetComponentInChildren <MeshRenderer>().material;
 }
 private void Awake()
 {
     netEntity = GetComponent <UnityNetEntity>().netEntity;
 }