当前位置: 首页>>代码示例>>C#>>正文


C# Fish.getSpeed方法代码示例

本文整理汇总了C#中Fish.getSpeed方法的典型用法代码示例。如果您正苦于以下问题:C# Fish.getSpeed方法的具体用法?C# Fish.getSpeed怎么用?C# Fish.getSpeed使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fish的用法示例。


在下文中一共展示了Fish.getSpeed方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Update


//.........这里部分代码省略.........
                    }

                    if (!fishAttached)
                    {
                        Debug.Log("Caught a random fish");

                        fishAttached = true;
                        Gauge.fishGauge.enabled = true;

                        hookedFish = fishManager.GetComponent<FishManager>().hookFish();
                        hookedFish.setDistance(boatDistance);

                       hookHinge = Instantiate(Resources.Load("Prefabs/CharacterHook"), rb.position, Quaternion.identity) as GameObject;

                       //hookHinge = Instantiate(Resources.Load("Prefabs/HookHinges3"), rb.position, Quaternion.identity) as GameObject;
                       //GameObject Connecter = GameObject.Find("HookJoint");
                       //HingeJoint hj = Connecter.GetComponent<HingeJoint>();
                        //hj.connectedBody = rb;

                        string fishPrefab = hookedFish.getPrefab();

                    fish = Instantiate(Resources.Load("Prefabs/Fish/" + fishPrefab), new Vector3(rb.position.x,rb.position.y-0.1f,rb.position.z), Quaternion.identity) as GameObject;
                    //fish = Instantiate(Resources.Load("Prefabs/Fish/" + fishPrefab), rb.position, Quaternion.identity) as GameObject;
        //                        GameObject hookJointGO = GameObject.Find("FishJoint");
        //                        HingeJoint fishJoint = fish.GetComponent<HingeJoint>();

                        GameObject hookOfHook = GameObject.Find("CharacterHookHook");
                        hookOfHook.GetComponent<CharacterJoint>().connectedBody = fish.GetComponent<Rigidbody>();

                        hookHinge.transform.parent = rb.transform;
                        //hookHinge = fish.GetComponent<Rigidbody>();

                        rb.useGravity = false;
                        swimSpeed = hookedFish.getSpeed();
                    }
                }

                randomTrigger = Random.Range(0, 50);

                Quaternion rotation2 = Quaternion.LookRotation(rb.position - rodEnd.transform.position);
                Quaternion rotation3 = Quaternion.Euler(rotation2.x, rotation2.y + randomDir, rotation2.z);
                rb.rotation = rotation3;

                Vector3 towardsRod = Vector3.MoveTowards(rb.position, rodEnd.transform.position, step);
                Vector3 swimVec = -rb.transform.forward * (swimSpeed * Time.deltaTime);
                Vector3 newPos = towardsRod - swimVec;

                rb.position = newPos;

                rodPullFactor = 0;

                if (bobber.GetComponent<Bobber>().reelMeUp == true || Vector3.Distance(bobber.transform.position,boatPos) < 6.0f)
                    status = "reeling up";

                break;

            // Hook has reached the boat, reel now goes up towards rodEnd
            case "reeling up":

                float distance = Vector3.Distance(rb.position, rodEnd.transform.position);
                if (distance < 0.01f)
                {
                    bobber.transform.parent = rodTip.transform;
                    if (!androidUIEnabled)
                    {
                        nView.RPC("enableCaughtUI", RPCMode.All,hookedFish.getName(),hookedFish.getWeight());
开发者ID:kurix2,项目名称:FishFishRevolution-PC,代码行数:67,代码来源:RodStatus.cs


注:本文中的Fish.getSpeed方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。