Beispiel #1
0
 public void Awake()
 {
     // Create an array of TransformInterpolator for each observed Transformation
     if (observedComponents.Count > 0)
     {
         cipols = new ComponentInterpolator[observedComponents.Count];
         int i = 0;
         foreach (Component c in observedComponents)
         {
             cipols[i++] = new ComponentInterpolator(this, c);
         }
     }
     else
     {
         // If no specific transforms are specified we use the one in the
         // GameObject that this script is attached to
         Rigidbody rbody = GetComponent <Rigidbody>();
         cipols    = new ComponentInterpolator[rbody == null ? 1 : 2];
         cipols[0] = new ComponentInterpolator(this, transform);
         if (rbody != null)
         {
             cipols[1] = new ComponentInterpolator(this, rbody);
         }
     }
 }
Beispiel #2
0
        public void Awake()
        {
            Rigidbody rbody = GetComponent <Rigidbody>();

            cipols    = new ComponentInterpolator[rbody == null ? 1 : 2];
            cipols[0] = new ComponentInterpolator(this, transform);
            if (rbody != null)
            {
                cipols[1] = new ComponentInterpolator(this, rbody);
            }
        }
Beispiel #3
0
    private ComponentInterpolator[] m_ComponentInterpolators;              //The components that are registered as sycnable (currently only supports Transform and Rigidbody)

    #region Unity Methods
    protected override void Awake()
    {
        base.Awake();
        rigidbody = GetComponent <Rigidbody>();

        m_ComponentInterpolators    = new ComponentInterpolator[rigidbody == null ? 1 : 2];
        m_ComponentInterpolators[0] = new ComponentInterpolator(this, transform);
        if (rigidbody != null)
        {
            m_ComponentInterpolators[1] = new ComponentInterpolator(this, rigidbody);
        }
    }
Beispiel #4
0
        public void Awake()
        {
            Rigidbody rbody = GetComponent <Rigidbody>();

            cipols    = new ComponentInterpolator[rbody == null ? 1 : 2];
            cipols[0] = new ComponentInterpolator(this, transform);
            if (rbody != null)
            {
                cipols[1] = new ComponentInterpolator(this, rbody);
            }

            if (VRFPS_GameController.instance != null)
            {
                playerHealth  = VRFPS_GameController.instance.initialHealth;
                playerBullets = VRFPS_GameController.instance.initialAmmoCount;
            }
        }