Example #1
0
 public static void ApplySkCameraEffect(int id, Pathea.PESkEntity skEntity)
 {
     Pathea.MainPlayerCmpt mainPlayerCmpt = skEntity.GetComponent <Pathea.MainPlayerCmpt>();
     if (mainPlayerCmpt != null)
     {
         if (id == 1)
         {
             PlayAttackShake();
         }
     }
 }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        Pathea.MainPlayerCmpt playerCmpt = other.GetComponentInParent <Pathea.MainPlayerCmpt>();

        // Ignore overlaps with anything other than the player
        if (playerCmpt == null)
        {
            return;
        }

        currentState         = DoorState.Opening;
        doorComponent.IsOpen = true;
    }
Example #3
0
        public override void Start()
        {
            base.Start();

            m_MoveState   = new List <Vector3> (MoveRecordCount);
            m_MoveRequest = new List <Vector3> (MoveRequestCount);

            gMainPlayer = this;
            gameObject.AddComponent <Scanner> ();
            mMove      = Entity.GetCmpt <Motion_Move_Human> ();
            mEquip     = Entity.motionEquipment;
            mView      = Entity.biologyViewCmpt;
            mTrans     = Entity.peTrans;
            mIK        = Entity.GetCmpt <IKCmpt> ();
            m_Skill    = Entity.aliveEntity;
            mPackage   = Entity.GetCmpt <PackageCmpt> ();
            mPassenger = Entity.passengerCmpt;
            mMotionMgr = Entity.motionMgr;
            mMotionMgr.onActionStart += OnActionStart;
            mMotionMgr.onActionEnd   += OnActionEnd;
            m_Abnormalcmpt            = Entity.Alnormal;

            if (null != m_Abnormalcmpt)
            {
                m_Abnormalcmpt.evtStart += OnStartAbnormal;
                m_Abnormalcmpt.evtEnd   += OnEndAbnormal;
            }

            if (null != m_Skill)
            {
                m_Skill.onHpReduce     += OnDamage;
                m_Skill.attackEvent    += OnAttack;
                m_Skill.deathEvent     += OnDeath;
                m_Skill.onSkillEvent   += OnSkillTarget;
                m_Skill.onWeaponAttack += OnWeaponAttack;

                m_Skill.OnBeEnemyEnter += OnBeEnemyEnter;
            }

            if (!PeGameMgr.IsTutorial)
            {
                StartCoroutine(UpdateAbnormalNotice());
            }

            //历险模式下此时初始化声望系统,ForceSetting并未加载,会导致声望系统不能正常起作用
            //InitReputationSystem();
            Invoke("CheckAbnormalState", 5f);
        }
Example #4
0
    private void OnTriggerEnter(Collider c)
    {
        if (isOpening)
        {
            return;
        }
        //new
        Pathea.MainPlayerCmpt playerCmpt = c.GetComponentInParent <Pathea.MainPlayerCmpt>();

        // Ignore overlaps with anything other than the player
        if (playerCmpt == null)
        {
            return;
        }
        if (RandomDungenMgr.Instance.HasKey(keyID))
        {
            ScreenText.Log("Opened {0} door", Key.Name);

            RandomDungenMgr.Instance.RemoveKey(keyID);
            Open();
        }
        else
        {
            ScreenText.Log("{0} key required", Key.Name);
        }


        //origin
//		var inventory = c.GetComponent<PlayerInventory>();
//
//		if(inventory == null)
//			return;
//
//		if(inventory.HasKey(keyID))
//		{
//			ScreenText.Log("Opened {0} door", Key.Name);
//
//			inventory.RemoveKey(keyID);
//			Open();
//		}
//		else
//			ScreenText.Log("{0} key required", Key.Name);
    }
Example #5
0
    private void OnTriggerExit(Collider other)
    {
        //origin
//		PlayerController playerController = other.GetComponent<PlayerController>();
//
//		// Ignore overlaps with anything other than the player
//		if (playerController == null)
//			return;

        //new
        Pathea.MainPlayerCmpt playerCmpt = other.GetComponentInParent <Pathea.MainPlayerCmpt>();

        // Ignore overlaps with anything other than the player
        if (playerCmpt == null)
        {
            return;
        }

        currentState = DoorState.Closing;
    }
    private void OnTriggerEnter(Collider c)
    {
        //origin
//		var inventory = c.GetComponent<PlayerInventory>();
//
//		if(inventory == null)
//			return;
//
//		ScreenText.Log("Picked up {0} key", Key.Name);
//		inventory.AddKey(keyID);
//		UnityUtil.Destroy(gameObject);

        //new
        Pathea.MainPlayerCmpt playerCmpt = c.GetComponentInParent <Pathea.MainPlayerCmpt>();

        // Ignore overlaps with anything other than the player
        if (playerCmpt == null)
        {
            return;
        }
        RandomDungenMgr.Instance.PickUpKey(keyID);
        ScreenText.Log("Picked up {0} key", Key.Name);
        UnityUtil.Destroy(gameObject);
    }