當前位置: 首頁>>代碼示例>>C#>>正文


C# BThirdPerson類代碼示例

本文整理匯總了C#中BThirdPerson的典型用法代碼示例。如果您正苦於以下問題:C# BThirdPerson類的具體用法?C# BThirdPerson怎麽用?C# BThirdPerson使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BThirdPerson類屬於命名空間,在下文中一共展示了BThirdPerson類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: handleInput

    public override ControllState handleInput(BThirdPerson controller, CharacterStats stats)
    {
        Vector3 mousePoint = Vector3.zero;
        stats.healthRegenerationRate = 0f;
        stats.enduranceRegenerationRate = 0f;

        if(controller.stateTime < 0.1){
            controller.controller.slotRightHand.GetComponent<OWeapon>().enable();
            shot = false;
            Vector2 inputVector = new Vector2(Input.GetAxis("Horizontal"),Input.GetAxis("Vertical"));
            Vector3 inputVectorTransformed = new Vector3(inputVector.x,0,-inputVector.y);
            Vector3 lookTarget = controller.position + (ControllerCamera.hingeUp.transform.rotation*inputVectorTransformed);
            controller.turn(lookTarget);
        }

        if(Input.GetButtonDown("attack") && stats.reduceEndurance(7) && !shot){
            shot = true;
        }

        if(controller.stateTime > 0.22f){
            if(shot){
                return ControllerKnight._KnightATTACKB;
            }
            else{
                controller.controller.slotRightHand.GetComponent<OWeapon>().disable();
                return ControllerKnight._KnightIDLE;
            }
        }

        return this;
    }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:31,代碼來源:ControllStateKnight.cs

示例2: handleInput

    public override ControllState handleInput(BThirdPerson controller, CharacterStats stats)
    {
        if(controller.stateTime > 5.625){

        }
        return this;
    }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:7,代碼來源:ControllStateCrow.cs

示例3: handleInput

    public override ControllState handleInput(BThirdPerson controller, CharacterStats stats)
    {
        Vector3 mousePoint = Vector3.zero;
        stats.healthRegenerationRate = 0f;
        stats.enduranceRegenerationRate = 0f;

        if(controller.stateTime < 0.1){
            controller.turnToReferenceObject();
            controller.controller.slotRightHand.GetComponent<OWeapon>().enable();
            shot = false;
        }

        if(Random.Range(1,10) < 3){
            shot = true;
        }

        if(controller.stateTime > 0.22f){
            if(shot){
                return ControllerZombie._ZombieATTACKB;
            }
            else{
                controller.controller.slotRightHand.GetComponent<OWeapon>().disable();
                return ControllerZombie._ZombieIDLE;
            }
        }

        return this;
    }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:28,代碼來源:ControllStateZombie.cs

示例4: onHit

 public static void onHit(BThirdPerson controller, Collider collider, CharacterStats stats)
 {
     OStroke stroke = collider.gameObject.GetComponent<OStroke>();
     if(stroke){
         controller.hitBack(stroke.strokeForce, collider.gameObject);
         stats.reduceHealthImpact(stroke.strength);
     }
     else{
         stats.reduceHealthImpact(5f);
     }
 }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:11,代碼來源:ControllerCrow.cs

示例5: handleTriggerStay

 public override ControllState handleTriggerStay(Collider collider, BThirdPerson controller, CharacterStats stats)
 {
     return this;
 }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:4,代碼來源:ControllStateKnight.cs

示例6: handleTriggerStay

 public override ControllState handleTriggerStay(Collider collider, BThirdPerson controller, CharacterStats stats)
 {
     if(collider.tag == "Stroke"){
         controller.controller.onHit(collider.GetComponent<OStroke>());
         return ControllerZombie._ZombieGETHIT;
     }
     return this;
 }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:8,代碼來源:ControllStateZombie.cs

示例7: Initialize

 protected void Initialize()
 {
     _BThirdPerson = gameObject.GetComponent<BThirdPerson>();
     _BThirdPersonMotionSystem = gameObject.GetComponent<BThirdPersonMotionSystem>();
     _BThirdPerson.controller = this;
     _BAudioPlayer = gameObject.GetComponent<BAudioPlayer>();
     material = renderer.material;
     setSlotsHand();
 }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:9,代碼來源:Controller.cs

示例8: handleCollissionEnter

 public override ControllState handleCollissionEnter(Collision collision, BThirdPerson controller, CharacterStats stats)
 {
     return this;
 }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:4,代碼來源:ControllStateKnight.cs

示例9: Start

 void Start()
 {
     controller = gameObject.GetComponent<BThirdPerson>();
 }
開發者ID:FabianSchempp,項目名稱:DUNDON,代碼行數:4,代碼來源:BThirdPersonMotionSystem.cs


注:本文中的BThirdPerson類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。