Inheritance: Behaviour
コード例 #1
0
    static void NetworkView_owner(JSVCall vc)
    {
        UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
        var result = _this.owner;

        JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
    }
                private KeyValuePair <GameObject, Prefab> ReplacePrefabInstance(UnityEngine.NetworkView oldView)
                {
                    var    prefabView = PrefabUtility.GetPrefabParent(oldView) as UnityEngine.NetworkView;
                    Prefab prefab     = null;

                    if (prefabView != null)
                    {
                        string prefabFile = AssetDatabase.GetAssetPath(prefabView);
                        prefab = prefabs.Find(prefabFile);

                        if (prefab == null)
                        {
                            prefab = new Prefab {
                                filename = prefabFile
                            };
                            if (!String.IsNullOrEmpty(prefabFile))
                            {
                                prefabs.Add(prefabFile, prefab);
                            }
                        }
                    }

                    var prefabInstance = PrefabUtility.FindPrefabRoot(oldView.gameObject);

                    Replace(oldView);

                    return(new KeyValuePair <GameObject, Prefab>(prefabInstance, prefab));
                }
コード例 #3
0
    static void NetworkView_isMine(JSVCall vc)
    {
        UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
        var result = _this.isMine;

        JSApi.setBooleanS((int)JSApi.SetType.Rval, (System.Boolean)(result));
    }
コード例 #4
0
ファイル: TestActor.cs プロジェクト: mbhuet/MastersProject
        private void Awake() {
            _transform = GetComponent<Transform>();
            _renderer = GetComponent<Renderer>();
            _networkView = GetComponent<NetworkView>();
            _destination = transform.position;
            _renderer.material.color = kColors[Random.Range(0, kColors.Length)];

            _transformInterpolation = new NetworkTransformInterpolation();
            _transformInterpolation.InterpolationBackTime = NetworkInterpolationBackTime;
        }
コード例 #5
0
        private void _getNetworkView()
        {
            GameObject go = Fsm.GetOwnerDefaultTarget(gameObject);
            if (go == null)
            {
                return;
            }

            _networkView =  go.GetComponent<NetworkView>();
        }
コード例 #6
0
        void Awake()
        {
            // Create a layer mask for the floor layer.
            floorMask = LayerMask.GetMask ("Floor");

            // Set up references.
            anim = GetComponent <Animator> ();
            playerRigidbody = GetComponent <Rigidbody> ();

            netView = GetComponent<NetworkView>();
        }
コード例 #7
0
        void Awake()
        {
            // Create a layer mask for the Shootable layer.
            shootableMask = LayerMask.GetMask ("Shootable");

            // Set up the references.
            gunParticles = GetComponent<ParticleSystem> ();
            gunLine = GetComponent <LineRenderer> ();
            audioSource = GetComponents<AudioSource>();
            gunLight = GetComponent<Light> ();

            // Get the network view
            netView = GetComponentInParent<NetworkView>();
        }
コード例 #8
0
// fields

// properties
    static void NetworkView_observed(JSVCall vc)
    {
        if (vc.bGet)
        {
            UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
            var result = _this.observed;
            JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
        }
        else
        {
            UnityEngine.Component   arg0  = (UnityEngine.Component)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
            UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
            _this.observed = arg0;
        }
    }
コード例 #9
0
 static void NetworkView_stateSynchronization(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
         var result = _this.stateSynchronization;
         JSApi.setEnum((int)JSApi.SetType.Rval, (int)result);
     }
     else
     {
         UnityEngine.NetworkStateSynchronization arg0 = (UnityEngine.NetworkStateSynchronization)JSApi.getEnum((int)JSApi.GetType.Arg);
         UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
         _this.stateSynchronization = arg0;
     }
 }
コード例 #10
0
 static void NetworkView_viewID(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
         var result = _this.viewID;
         JSMgr.datax.setObject((int)JSApi.SetType.Rval, result);
     }
     else
     {
         UnityEngine.NetworkViewID arg0  = (UnityEngine.NetworkViewID)JSMgr.datax.getObject((int)JSApi.GetType.Arg);
         UnityEngine.NetworkView   _this = (UnityEngine.NetworkView)vc.csObj;
         _this.viewID = arg0;
     }
 }
コード例 #11
0
 static void NetworkView_group(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
         var result = _this.group;
         JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
     }
     else
     {
         System.Int32            arg0  = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
         UnityEngine.NetworkView _this = (UnityEngine.NetworkView)vc.csObj;
         _this.group = arg0;
     }
 }
                private void Replace(UnityEngine.NetworkView oldView)
                {
                    if (detailedLogging)
                    {
                        Debug.Log("Replacing a Scene's NetworkView (" + oldView.viewID + ") at GameObject '" + Utility.GetHierarchyName(oldView.transform) + "' in Scene: " + filename, oldView);
                    }

                    var newView = oldView.gameObject.AddComponent <uLink.NetworkView>();

                    newView.observed             = oldView.observed;
                    newView.stateSynchronization = Utility.ReplaceStateSync(oldView.stateSynchronization);
                    newView._manualViewID        = ++lastManualViewID;
                    EditorUtility.SetDirty(newView);

                    Object.DestroyImmediate(oldView, true);
                }
コード例 #13
0
    static int get_networkView(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.GameObject  obj = (UnityEngine.GameObject)o;
            UnityEngine.NetworkView ret = obj.networkView;
            ToLua.PushSealed(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index networkView on a nil value"));
        }
    }
コード例 #14
0
    static int get_networkView(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Component   obj = (UnityEngine.Component)o;
            UnityEngine.NetworkView ret = obj.networkView;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index networkView on a nil value" : e.Message));
        }
    }
コード例 #15
0
    void Awake()
    {
        // Setting up references.
        groundCheck = transform.Find("groundCheck");
        anim = GetComponent<Animator>();
        netView = this.GetComponent<UnityEngine.NetworkView>();
        rigidBody = GetComponent<Rigidbody2D>();

        guns = new List<Gun>(GetComponentsInChildren<Gun>());
        if(guns.Count > 0)
            equippedGun = guns[0];
    }
コード例 #16
0
 private static extern void Internal_RPC(NetworkView view, string name, RPCMode mode, object[] args);
コード例 #17
0
 private static extern void INTERNAL_CALL_Internal_SetViewID(NetworkView self, ref NetworkViewID viewID);
コード例 #18
0
 private static extern void Internal_RPC_Target(NetworkView view, string name, NetworkPlayer target, object[] args);
コード例 #19
0
 /// <summary>
 ///   <para>Find a network view based on a NetworkViewID.</para>
 /// </summary>
 /// <param name="viewID"></param>
 public static NetworkView Find(NetworkViewID viewID)
 {
     return(NetworkView.INTERNAL_CALL_Find(ref viewID));
 }
コード例 #20
0
 private void Internal_SetViewID(NetworkViewID viewID)
 {
     NetworkView.INTERNAL_CALL_Internal_SetViewID(this, ref viewID);
 }
コード例 #21
0
 public void RPC(string name, RPCMode mode, params object[] args)
 {
     NetworkView.Internal_RPC(this, name, mode, args);
 }
コード例 #22
0
 public bool SetScope(NetworkPlayer player, bool relevancy)
 {
     return(NetworkView.INTERNAL_CALL_SetScope(this, ref player, relevancy));
 }
コード例 #23
0
 private static void Internal_RPC(NetworkView view, string name, RPCMode mode, object[] args)
 {
     throw new NotImplementedException("なにこれ");
 }
コード例 #24
0
 private static void Internal_RPC_Target(NetworkView view, string name, NetworkPlayer target, object[] args)
 {
     throw new NotImplementedException("なにこれ");
 }
コード例 #25
0
 private static void INTERNAL_CALL_Internal_SetViewID(NetworkView self, ref NetworkViewID viewID)
 {
     throw new NotImplementedException("なにこれ");
 }
コード例 #26
0
 /// <summary>
 /// Caches all of the current standard components attached to the object.
 /// </summary>
 public void ResetCache()
 {
     animation = GetComponent<Animation>();
     audio = GetComponent<AudioSource>();
     camera = GetComponent<Camera>();
     collider = GetComponent<Collider>();
     collider2D = GetComponent<Collider2D>();
     constantForce = GetComponent<ConstantForce>();
     guiText = GetComponent<GUIText>();
     guiTexture = GetComponent<GUITexture>();
     hingeJoint = GetComponent<HingeJoint>();
     light = GetComponent<Light>();
     networkView = GetComponent<NetworkView>();
     particleEmitter = GetComponent<ParticleEmitter>();
     particleSystem = GetComponent<ParticleSystem>();
     renderer = GetComponent<Renderer>();
     rigidbody = GetComponent<Rigidbody>();
     rigidbody2D = GetComponent<Rigidbody2D>();
     transform = GetComponent<Transform>();
 }
コード例 #27
0
 /// <summary>
 /// Calls GetComponent for all cached components if the currently cached instance is no longer valid.
 /// </summary>
 public void ResetCacheDestroyed()
 {
     if (!animation)
     {
         animation = GetComponent<Animation>();
     }
     if (!audio)
     {
         audio = GetComponent<AudioSource>();
     }
     if (!camera)
     {
         camera = GetComponent<Camera>();
     }
     if (!collider)
     {
         collider = GetComponent<Collider>();
     }
     if (!collider2D)
     {
         collider2D = GetComponent<Collider2D>();
     }
     if (!constantForce)
     {
         constantForce = GetComponent<ConstantForce>();
     }
     if (!guiText)
     {
         guiText = GetComponent<GUIText>();
     }
     if (!guiTexture)
     {
         guiTexture = GetComponent<GUITexture>();
     }
     if (!hingeJoint)
     {
         hingeJoint = GetComponent<HingeJoint>();
     }
     if (!light)
     {
         light = GetComponent<Light>();
     }
     if (!networkView)
     {
         networkView = GetComponent<NetworkView>();
     }
     if (!particleEmitter)
     {
         particleEmitter = GetComponent<ParticleEmitter>();
     }
     if (!particleSystem)
     {
         particleSystem = GetComponent<ParticleSystem>();
     }
     if (!renderer)
     {
         renderer = GetComponent<Renderer>();
     }
     if (!rigidbody)
     {
         rigidbody = GetComponent<Rigidbody>();
     }
     if (!rigidbody2D)
     {
         rigidbody2D = GetComponent<Rigidbody2D>();
     }
     if (!transform)
     {
         transform = GetComponent<Transform>();
     }
 }
コード例 #28
0
 /// <summary>
 /// Caches the current NetworkView attached to the object.
 /// </summary>
 public void ResetNetworkViewCache()
 {
     networkView = GetComponent<NetworkView>();
 }
コード例 #29
0
 public void PostConstruct()
 {
     networkView = contextView.AddComponent<NetworkView> ();
 }
コード例 #30
0
ファイル: NetworkView.cs プロジェクト: randomize/VimConfig
 private static extern void Internal_RPC_Target(NetworkView view, string name, NetworkPlayer target, object[] args);
コード例 #31
0
 public void RPC(string name, NetworkPlayer target, params object[] args)
 {
     NetworkView.Internal_RPC_Target(this, name, target, args);
 }
コード例 #32
0
ファイル: FileTransfer.cs プロジェクト: mbhuet/MastersProject
 private void OnEnable() {
     _networkView = GetComponent<NetworkView>();
 }
コード例 #33
0
 private static extern void INTERNAL_CALL_Internal_SetViewID(NetworkView self, ref NetworkViewID viewID);
コード例 #34
0
ファイル: Manager.cs プロジェクト: s33hunt/3D-noise-world
		void Start()
		{
			serverIP = Network.player.ipAddress;
			networkView = GetComponent<NetworkView> ();
		}
コード例 #35
0
 private static extern void Internal_RPC(NetworkView view, string name, RPCMode mode, object[] args);
コード例 #36
0
ファイル: UnityNetwork.cs プロジェクト: devluz/webrtcnetwork
 private void Awake()
 {
     DontDestroyOnLoad(this.gameObject);
     glNetworkView = this.GetComponent<NetworkView>();
 }
コード例 #37
0
 private static extern void INTERNAL_CALL_Internal_RPC_Target(NetworkView view, string name, ref NetworkPlayer target, object[] args);
コード例 #38
0
 private static extern void INTERNAL_CALL_Internal_RPC_Target(NetworkView view, string name, ref NetworkPlayer target, object[] args);
コード例 #39
0
 private static extern bool INTERNAL_CALL_SetScope(NetworkView self, ref NetworkPlayer player, bool relevancy);
コード例 #40
0
 private static extern bool INTERNAL_CALL_SetScope(NetworkView self, ref NetworkPlayer player, bool relevancy);
コード例 #41
0
 private static void Internal_RPC_Target(NetworkView view, string name, NetworkPlayer target, object[] args)
 {
     INTERNAL_CALL_Internal_RPC_Target(view, name, ref target, args);
 }
コード例 #42
0
 private static void Internal_RPC_Target(NetworkView view, string name, NetworkPlayer target, object[] args)
 {
     INTERNAL_CALL_Internal_RPC_Target(view, name, ref target, args);
 }
コード例 #43
0
 public void SetNativeNetworkView(NetworkView nativeNetworkView)
 {
     _nativeNetworkView = nativeNetworkView;
 }
コード例 #44
0
ファイル: ConnectedPlayer.cs プロジェクト: psicomante/aamcg
 /// <summary>
 /// Initialize the player
 /// </summary>
 public void Start()
 {
     PowerUps = new List<PowerUp> ();
     ForceMultiplier = AmApplication.DEFAULT_FORCE_MULTIPLIER;
     CanFly = false;
     LastTouched = null;
     _touchCounter = 0;
     _comboScoreTemp = 0;
     _comboScoreMultiplier = 0;
     _killComboCounter = KILL_COMBO_DURATION;
     _networkView = GameObject.Find(AmApplication.GAMEOBJECT_MAP_GENERATOR_NAME).GetComponent<NetworkView>();
     _clientUpdateCounter = AmApplication.CLIENT_UPDATE_TIME;
     Debug.Log("Network view imported: " + _networkView);
     // resets score
     Score = 0;
 }