纳金网

标题: js 调用 C#问题 [打印本页]

作者: 她。    时间: 2012-12-29 10:16
标题: js 调用 C#问题
test1.js  

private var s:abc;

function Awake(){

s=this.GetComponent("abc");


}

function Start () {

}

function Update () {

print(abc.i);
}复制代码
abc.cs


using UnityEngine;
using System.Collections;

public class abc : MonoBehaviour {
        
        public float i =5.0F;
        // Use this for initialization
        void Start () {
        
        }
        
        // Update is called once per frame
        void Update () {
        
        }
}复制代码
怎么打印不出i的值

作者: 王者再临    时间: 2012-12-30 01:43
学习了,虽然还是有难度,谢谢楼主的用心




欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5