示例#1
0
    //private void FixedUpdate()
    //{
    //    if(!fallenInLine){
    //        if (timeToFallInLine > 0)
    //        {
    //            timeToFallInLine -= Time.fixedDeltaTime;
    //        }else if(frontFish != null)
    //        {
    //            GetComponent<HingeJoint>().connectedBody = frontFish.GetComponent<Rigidbody>();
    //            GetComponent<Collider>().enabled = true;
    //            fallenInLine = true;
    //        }
    //    }
    //}

    public void SetInk(avaliableColors newInk)
    {
        inkBox = FindObjectOfType <InkBox>();
        ink    = newInk;
        Color newColor = inkBox.colors[newInk];

        GetComponent <Light>().color = newColor;
        MeshRenderer[] emittingMeshes = GetComponentsInChildren <MeshRenderer>();
        foreach (MeshRenderer mesh in emittingMeshes)
        {
            if (mesh.gameObject.CompareTag("Emitting"))
            {
                mesh.material.SetColor("_EmissionColor", newColor);
            }
        }
    }
示例#2
0
 private void Start()
 {
     player = FindObjectOfType <PlayerController>();
     inkBox = FindObjectOfType <InkBox>();
 }
示例#3
0
 private void Start()
 {
     inkBox    = FindObjectOfType <InkBox>();
     rigidbody = gameObject.GetComponent <Rigidbody>();
     SetInk(ink);
 }