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


C# Ingredient.GetComponent方法代码示例

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


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

示例1: MoveTo

 public void MoveTo(Ingredient ingredient, Transform t, TweenCallback callback)
 {
     //Should tween
     //ingredient.transform.position = t.position;
     ingredient.GetComponent<Rigidbody>().DOMove(t.position, 1f).OnComplete(callback);
     ingredient.GetComponent<Rigidbody>().velocity = Vector3.zero;
 }
开发者ID:hubatish,项目名称:barVR,代码行数:7,代码来源:PlayerHand.cs

示例2: Grab

 public void Grab(Ingredient ingredient)
 {
     if (heldIngredient != null)
     {
         //derp, git change
         ReleaseWithForce();
     }
     heldIngredient = ingredient;
     heldIngredient.GetComponent<Rigidbody>().useGravity = false;
     heldIngredient.GetComponent<Collider>().enabled = false;
     MoveTo(ingredient, transform);
 }
开发者ID:hubatish,项目名称:barVR,代码行数:12,代码来源:PlayerHand.cs

示例3: RemoveIngredient

 public void RemoveIngredient(Ingredient ingredient)
 {
     if (curIngredients.Contains(ingredient))
     {
         ingredient.GetComponent<Rigidbody>().isKinematic = false;
         curIngredients.Remove(ingredient);
         ingredient.onSelect = delegate () { };
     }
 }
开发者ID:hubatish,项目名称:barVR,代码行数:9,代码来源:BaseStation.cs

示例4: AddIngredient

    public void AddIngredient(Ingredient ingredient)
    {
        if (curIngredients.Count >= ingredientSpots.Count)
        {
            PlayerHand.Instance.DropIngredient();
            return;
        }
        int numI = curIngredients.Count;
        ingredient.GetComponent<Collider>().enabled = false;

        PlayerHand.Instance.MoveTo(ingredient, ingredientSpots[numI],delegate()
        {
            //ingredient.transform.SetParent(ingredientSpots[numI]);
            ingredient.transform.position = ingredientSpots[numI].position;
            ingredient.GetComponent<Collider>().enabled = true;
            ingredient.GetComponent<Rigidbody>().isKinematic = true;
        });
        curIngredients.Add(ingredient);
        ingredient.onSelect += delegate ()
        {
            RemoveIngredient(ingredient);
        };
    }
开发者ID:hubatish,项目名称:barVR,代码行数:23,代码来源:BaseStation.cs

示例5: FinishPrep

    public void FinishPrep()
    {
        // anim.SetTrigger(boilhash);

        product = MasterIngredientList.Instance.CombineIngredients(curIngredients, method);
        product.transform.position = ingredientSpots[0].position;

        Debug.Log("Done prepping!"+product.name);

        Vector3 towardsZero = (Camera.main.transform.position - transform.position).normalized;
        towardsZero.y += 0.2f;
        product.GetComponent<Rigidbody>().AddForce(towardsZero * 0.3f);

        ClearIngredients();
        if (animEffect != null)
        {
            animEffect.SetActive(false);
        }
    }
开发者ID:hubatish,项目名称:barVR,代码行数:19,代码来源:PreparationStation.cs


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