示例#1
0
    public void init(
        NetworkPrefabLoader loader,
        GameData.TEAM team, EntityPlayer entity, Rigidbody rigidBody,
        Vector3 position, Vector3 to)
    {
        PhysicsLayer.SET_ATTACK(prefab, team);

        reader.enabled  = true;
        reader.m_entity = entity;
        loadRocketModel.networkloader    = loader;
        loadExplosionModel.networkloader = loader;
        loadRocketModel.team             = team;
        loadExplosionModel.team          = team;
        move.m_rigidBody         = rigidBody;
        destroyNetworkObject.obj = entity.gameObject;
        destroyNetworkObject.isNetworkedObject = true;
        if (team == GameData.TEAM.RED)
        {
            loadExplosionPlayer.layer = PHYSICS_LAYER.LAYER_RED_ATTACK;
        }
        else
        {
            loadExplosionPlayer.layer = PHYSICS_LAYER.LAYER_BLUE_ATTACK;
        }
        this.transform.parent        = entity.transform;
        this.transform.localPosition = Vector3.zero;
        this.transform.localRotation = Quaternion.identity;

        entity.transform.position = position;
        entity.transform.LookAt(to);
    }
示例#2
0
    //public NEntity.NScript.EntityScriptReader reader;


    //public NEntity.NScript.LoadNetworkPrefab loadRocketModel;
    //public NEntity.NScript.MoveForward move;
    //public NEntity.NScript.LoadNetworkPrefab loadExplosionModel;
    //public NEntity.NScript.LoadPrefab loadExplosionPlayer;
    //public NEntity.NScript.GameObjectDestroy destroyNetworkObject;

    public void init(
        NetworkPrefabLoader loader,
        GameData.TEAM team, EntityPlayer entity, Rigidbody krigidBody,
        Vector3 position, Vector3 to)
    {
        PhysicsLayer.SET_ATTACK(m_prefab, team);
        m_team          = team;
        m_networkloader = loader;
        m_networkloader.RpcLoadPrefab_ParentMe(PREFAB_ID.GRENADE, team);
        krigidBody.AddForce(entity.transform.rotation * m_initialForce, ForceMode.Impulse);
        //krigidBody.isKinematic = false;
        //m_explosion.gameObject.SetActive(false);
        m_entity    = entity;
        m_rigidbody = krigidBody;
        //Debug.Log(m_rigidbody);
        m_networkloader           = loader;
        m_triggerEnter.m_isRepeat = true;
        m_triggerEnter.resetCollisionCheck();
        m_triggerEnter.addHdr(onCollision);
        m_prefab.setLayer(PhysicsLayer.GET_LAYER(
                              (team == GameData.TEAM.RED) ? PHYSICS_LAYER.LAYER_RED_ATTACK : PHYSICS_LAYER.LAYER_BLUE_ATTACK));
    }
示例#3
0
 public void init(GameData.TEAM team)
 {
     PhysicsLayer.SET_ATTACK(m_prfAttack, team);
     PhysicsLayer.SET_SHIELD(m_prfShield, team);
 }